st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 1 | # Dockerfile for image with ONAP Portal |
| 2 | |
| 3 | # Yields an image 823 MB |
| 4 | FROM frolvlad/alpine-oraclejdk8:slim |
| 5 | # Yields an image 1.4 GB |
| 6 | # FROM openjdk:8-jdk |
| 7 | |
| 8 | # Arguments are supplied by build.sh script |
| 9 | # the defaults below only support testing |
| 10 | ARG PORTAL_WAR=build/ecompportal-be-os.war |
| 11 | ARG FE_DIR=build/public |
| 12 | ARG HTTP_PROXY |
| 13 | ARG HTTPS_PROXY |
Kishore Reddy, Gujja (kg811t) | a59bc3e | 2018-09-25 13:59:56 -0400 | [diff] [blame^] | 14 | # ARG PORTAL_CERT=truststoreONAPall.jks |
st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 15 | |
| 16 | # Just variables, never passed in |
| 17 | ARG TOMCAT=apache-tomcat-8.0.37 |
| 18 | ARG TOMCATTAR=${TOMCAT}.tar.gz |
| 19 | ARG TOMCATHOME=/opt/${TOMCAT} |
| 20 | ARG PORTALCONTEXT=ONAPPORTAL |
| 21 | |
| 22 | ENV http_proxy $HTTP_PROXY |
| 23 | ENV https_proxy $HTTPS_PROXY |
| 24 | RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \ |
| 25 | if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi |
| 26 | |
| 27 | # Install Tomcat. This image already has curl. |
| 28 | WORKDIR /tmp |
| 29 | RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz |
| 30 | RUN tar -xzf ${TOMCATTAR} |
| 31 | RUN rm ${TOMCATTAR} |
| 32 | # Remove manager and sample apps |
| 33 | RUN rm -fr ${TOMCAT}/webapps/[a-z]* |
| 34 | RUN mkdir -p /opt |
Kishore Reddy, Gujja (kg811t) | a59bc3e | 2018-09-25 13:59:56 -0400 | [diff] [blame^] | 35 | COPY ${SERVERXML} ${TOMCAT}/conf |
st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 36 | RUN mv ${TOMCAT} /opt |
| 37 | |
| 38 | WORKDIR ${TOMCATHOME}/webapps |
| 39 | RUN mkdir ${PORTALCONTEXT} |
| 40 | |
| 41 | # Portal has many parts |
| 42 | COPY $PORTAL_WAR ${PORTALCONTEXT} |
| 43 | RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war |
| 44 | COPY ${FE_DIR} ${PORTALCONTEXT}/public |
| 45 | |
| 46 | VOLUME ${TOMCATHOME}/logs |
| 47 | |
| 48 | # Switch back to root |
| 49 | WORKDIR / |
| 50 | |
| 51 | # Define commonly used ENV variables |
| 52 | ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin |
| 53 | # Install the launch script |
| 54 | COPY start-apache-tomcat.sh / |
| 55 | |
| 56 | # Define default command |
| 57 | CMD /start-apache-tomcat.sh |