blob: 9b9f548926da2997bb3573189b0112e5e2e98bcf [file] [log] [blame]
st782s21a87612018-01-30 17:29:36 -05001# Dockerfile for image with ONAP Portal
2
3# Yields an image 823 MB
4FROM 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
10ARG PORTAL_WAR=build/ecompportal-be-os.war
11ARG FE_DIR=build/public
12ARG HTTP_PROXY
13ARG HTTPS_PROXY
Kishore Reddy, Gujja (kg811t)a59bc3e2018-09-25 13:59:56 -040014# ARG PORTAL_CERT=truststoreONAPall.jks
st782s21a87612018-01-30 17:29:36 -050015
16# Just variables, never passed in
17ARG TOMCAT=apache-tomcat-8.0.37
18ARG TOMCATTAR=${TOMCAT}.tar.gz
19ARG TOMCATHOME=/opt/${TOMCAT}
20ARG PORTALCONTEXT=ONAPPORTAL
21
22ENV http_proxy $HTTP_PROXY
23ENV https_proxy $HTTPS_PROXY
24RUN 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.
28WORKDIR /tmp
29RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
30RUN tar -xzf ${TOMCATTAR}
31RUN rm ${TOMCATTAR}
32# Remove manager and sample apps
33RUN rm -fr ${TOMCAT}/webapps/[a-z]*
34RUN mkdir -p /opt
Kishore Reddy, Gujja (kg811t)a59bc3e2018-09-25 13:59:56 -040035COPY ${SERVERXML} ${TOMCAT}/conf
st782s21a87612018-01-30 17:29:36 -050036RUN mv ${TOMCAT} /opt
37
38WORKDIR ${TOMCATHOME}/webapps
39RUN mkdir ${PORTALCONTEXT}
40
41# Portal has many parts
42COPY $PORTAL_WAR ${PORTALCONTEXT}
43RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
44COPY ${FE_DIR} ${PORTALCONTEXT}/public
45
46VOLUME ${TOMCATHOME}/logs
47
48# Switch back to root
49WORKDIR /
50
51# Define commonly used ENV variables
52ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
53# Install the launch script
54COPY start-apache-tomcat.sh /
55
56# Define default command
57CMD /start-apache-tomcat.sh