blob: b4c759fae5e2169fb4f1396c9d4354f0820aba00 [file] [log] [blame]
st782s21a87612018-01-30 17:29:36 -05001# Dockerfile for image with ONAP Portal
2
Sylvain Desbureaux39920042019-03-04 08:45:37 +01003# Multistage to be able to have SDK war content and not war itself
4FROM busybox:latest AS war-decompress
5
6# Arguments are supplied by build.sh script
7# the defaults below only support testing
8ARG PORTAL_WAR=build/ecompportal-be-os.war
9ARG FE_DIR=build/public
10
11# Just variables, never passed in
12ARG PORTALCONTEXT=ONAPPORTAL
13
14RUN mkdir ${PORTALCONTEXT}
15
16# Portal has many parts
17COPY $PORTAL_WAR ${PORTALCONTEXT}
18RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
19COPY ${FE_DIR} ${PORTALCONTEXT}/public
20
st782s21a87612018-01-30 17:29:36 -050021# Yields an image 823 MB
Manoop Talasilaa0c16db2019-02-08 13:47:48 -050022FROM openjdk:8-alpine
st782s21a87612018-01-30 17:29:36 -050023# 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
28ARG PORTAL_WAR=build/ecompportal-be-os.war
29ARG FE_DIR=build/public
30ARG HTTP_PROXY
31ARG HTTPS_PROXY
Kishore Reddy, Gujja (kg811t)a59bc3e2018-09-25 13:59:56 -040032# ARG PORTAL_CERT=truststoreONAPall.jks
st782s21a87612018-01-30 17:29:36 -050033
34# Just variables, never passed in
Sylvain Desbureaux39920042019-03-04 08:45:37 +010035ARG TOMCAT_VERSION=8.0.37
36ARG TOMCAT=apache-tomcat-${TOMCAT_VERSION}
st782s21a87612018-01-30 17:29:36 -050037ARG TOMCATTAR=${TOMCAT}.tar.gz
38ARG TOMCATHOME=/opt/${TOMCAT}
39ARG PORTALCONTEXT=ONAPPORTAL
40
41ENV http_proxy $HTTP_PROXY
42ENV https_proxy $HTTPS_PROXY
43RUN 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.
47WORKDIR /tmp
Sylvain Desbureaux39920042019-03-04 08:45:37 +010048RUN 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
st782s21a87612018-01-30 17:29:36 -050054
Sylvain Desbureaux39920042019-03-04 08:45:37 +010055COPY --from=war-decompress /${PORTALCONTEXT} ${TOMCATHOME}/webapps/${PORTALCONTEXT}/
st782s21a87612018-01-30 17:29:36 -050056
57VOLUME ${TOMCATHOME}/logs
58
59# Switch back to root
60WORKDIR /
61
62# Define commonly used ENV variables
63ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
64# Install the launch script
65COPY start-apache-tomcat.sh /
66
67# Define default command
68CMD /start-apache-tomcat.sh