1 # Dockerfile for image with ONAP Portal
3 # Multistage to be able to have SDK war content and not war itself
4 FROM busybox:latest AS war-decompress
6 # Arguments are supplied by build.sh script
7 # the defaults below only support testing
8 ARG PORTAL_WAR=build/ecompportal-be-os.war
9 ARG FE_DIR=build/public
11 # Just variables, never passed in
12 ARG PORTALCONTEXT=ONAPPORTAL
14 RUN mkdir ${PORTALCONTEXT}
16 # Portal has many parts
17 COPY $PORTAL_WAR ${PORTALCONTEXT}
18 RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
19 COPY ${FE_DIR} ${PORTALCONTEXT}/public
21 # Yields an image 823 MB
23 # Yields an image 1.4 GB
26 # Arguments are supplied by build.sh script
27 # the defaults below only support testing
28 ARG PORTAL_WAR=build/ecompportal-be-os.war
29 ARG FE_DIR=build/public
32 # ARG PORTAL_CERT=truststoreONAPall.jks
34 # Just variables, never passed in
35 ARG TOMCAT_VERSION=8.0.37
36 ARG TOMCAT=apache-tomcat-${TOMCAT_VERSION}
37 ARG TOMCATTAR=${TOMCAT}.tar.gz
38 ARG TOMCATHOME=/opt/${TOMCAT}
39 ARG PORTALCONTEXT=ONAPPORTAL
41 ENV http_proxy $HTTP_PROXY
42 ENV https_proxy $HTTPS_PROXY
43 RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
44 if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
46 # Install Tomcat. This image already has curl.
48 RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/${TOMCATTAR} && \
49 tar -xzf ${TOMCATTAR} && \
51 rm -fr ${TOMCAT}/webapps/* &&\
55 COPY --from=war-decompress /${PORTALCONTEXT} ${TOMCATHOME}/webapps/${PORTALCONTEXT}/
57 VOLUME ${TOMCATHOME}/logs
62 # Define commonly used ENV variables
63 ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
64 # Install the launch script
65 COPY start-apache-tomcat.sh /
67 # Define default command
68 CMD /start-apache-tomcat.sh