st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 1 | # Dockerfile for image with ONAP Portal |
| 2 | |
Sylvain Desbureaux | 3992004 | 2019-03-04 08:45:37 +0100 | [diff] [blame] | 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 PORTAL_WAR=build/ecompportal-be-os.war |
| 9 | ARG FE_DIR=build/public |
| 10 | |
| 11 | # Just variables, never passed in |
| 12 | ARG PORTALCONTEXT=ONAPPORTAL |
| 13 | |
| 14 | RUN mkdir ${PORTALCONTEXT} |
| 15 | |
| 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 |
| 20 | |
st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 21 | # Yields an image 823 MB |
Manoop Talasila | a0c16db | 2019-02-08 13:47:48 -0500 | [diff] [blame] | 22 | FROM openjdk:8-alpine |
st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 23 | # Yields an image 1.4 GB |
| 24 | # FROM openjdk:8-jdk |
| 25 | |
| 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 |
| 30 | ARG HTTP_PROXY |
| 31 | ARG HTTPS_PROXY |
Kishore Reddy, Gujja (kg811t) | a59bc3e | 2018-09-25 13:59:56 -0400 | [diff] [blame] | 32 | # ARG PORTAL_CERT=truststoreONAPall.jks |
st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 33 | |
| 34 | # Just variables, never passed in |
Sylvain Desbureaux | 3992004 | 2019-03-04 08:45:37 +0100 | [diff] [blame] | 35 | ARG TOMCAT_VERSION=8.0.37 |
| 36 | ARG TOMCAT=apache-tomcat-${TOMCAT_VERSION} |
st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 37 | ARG TOMCATTAR=${TOMCAT}.tar.gz |
| 38 | ARG TOMCATHOME=/opt/${TOMCAT} |
| 39 | ARG PORTALCONTEXT=ONAPPORTAL |
| 40 | |
| 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 |
| 45 | |
| 46 | # Install Tomcat. This image already has curl. |
| 47 | WORKDIR /tmp |
Sylvain Desbureaux | 3992004 | 2019-03-04 08:45:37 +0100 | [diff] [blame] | 48 | RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/${TOMCATTAR} && \ |
| 49 | tar -xzf ${TOMCATTAR} && \ |
| 50 | rm ${TOMCATTAR} &&\ |
| 51 | rm -fr ${TOMCAT}/webapps/* &&\ |
| 52 | mkdir -p /opt &&\ |
| 53 | mv ${TOMCAT} /opt |
st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 54 | |
Sylvain Desbureaux | 3992004 | 2019-03-04 08:45:37 +0100 | [diff] [blame] | 55 | COPY --from=war-decompress /${PORTALCONTEXT} ${TOMCATHOME}/webapps/${PORTALCONTEXT}/ |
st782s | 21a8761 | 2018-01-30 17:29:36 -0500 | [diff] [blame] | 56 | |
| 57 | VOLUME ${TOMCATHOME}/logs |
| 58 | |
| 59 | # Switch back to root |
| 60 | WORKDIR / |
| 61 | |
| 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 / |
| 66 | |
| 67 | # Define default command |
| 68 | CMD /start-apache-tomcat.sh |