1 # Dockerfile for image with ONAP Portal SDK demo app
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 SDK_WAR=build/epsdk-app-os.war
10 # Just variables, never passed in
11 ARG SDKCONTEXT=ONAPPORTALSDK
13 RUN mkdir ${SDKCONTEXT}
15 # SDK app has only a war
16 COPY $SDK_WAR ${SDKCONTEXT}
17 RUN cd ${SDKCONTEXT} && unzip -q *.war && rm *.war
20 # Yields an image 823 MB
22 # Yields an image 1.4 GB
24 ARG SDK_WAR=build/epsdk-app-os.war
28 # Just variables, never passed in
29 ARG TOMCAT_VERSION=8.0.37
30 ARG TOMCAT=apache-tomcat-${TOMCAT_VERSION}
31 ARG TOMCATTAR=${TOMCAT}.tar.gz
32 ARG TOMCATHOME=/opt/${TOMCAT}
33 ARG SDKCONTEXT=ONAPPORTALSDK
36 ENV http_proxy $HTTP_PROXY
37 ENV https_proxy $HTTPS_PROXY
38 RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
39 if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
41 # Install Tomcat. This image already has curl.
42 # Remove manager and sample apps
44 RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/${TOMCATTAR} && \
45 tar -xzf ${TOMCATTAR} && \
47 rm -fr ${TOMCAT}/webapps/[a-z]* &&\
51 COPY --from=war-decompress /${SDKCONTEXT} ${TOMCATHOME}/webapps/${SDKCONTEXT}/
53 VOLUME ${TOMCATHOME}/logs
58 # Define commonly used ENV variables
59 ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
60 # Install the launch script
61 COPY start-apache-tomcat.sh /
63 # Define default command
64 CMD /start-apache-tomcat.sh