Merge "Portal Spring Boot Development"
[portal.git] / deliveries / Dockerfile.sdk
1 # Dockerfile for image with ONAP Portal SDK demo app
2
3 # Multistage to be able to have SDK war content and not war itself
4 FROM busybox:latest AS war-decompress
5
6 # Arguments are supplied by build.sh script
7 # the defaults below only support testing
8 ARG SDK_WAR=build/epsdk-app-os.war
9
10 # Just variables, never passed in
11 ARG SDKCONTEXT=ONAPPORTALSDK
12
13 RUN mkdir ${SDKCONTEXT}
14
15 # SDK app has only a war
16 COPY $SDK_WAR ${SDKCONTEXT}
17 RUN cd ${SDKCONTEXT} && unzip -q *.war && rm *.war
18
19
20 # Yields an image 823 MB
21 FROM openjdk:8-alpine
22 # Yields an image 1.4 GB
23 # FROM openjdk:8-jdk
24 ARG SDK_WAR=build/epsdk-app-os.war
25 ARG HTTP_PROXY
26 ARG HTTPS_PROXY
27
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
34
35
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
40
41 # Install Tomcat.  This image already has curl.
42 # Remove manager and sample apps
43 WORKDIR /tmp
44 RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/${TOMCATTAR} && \
45     tar -xzf ${TOMCATTAR} && \
46     rm ${TOMCATTAR} &&\
47     rm -fr ${TOMCAT}/webapps/[a-z]* &&\
48     mkdir -p /opt &&\
49     mv ${TOMCAT} /opt
50
51 COPY --from=war-decompress /${SDKCONTEXT} ${TOMCATHOME}/webapps/${SDKCONTEXT}/
52
53 VOLUME ${TOMCATHOME}/logs
54
55 # Switch back to root
56 WORKDIR /
57
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 /
62
63 # Define default command
64 CMD /start-apache-tomcat.sh