blob: 81eeb6558cdde02a14dfe9186e463f987509b375 [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
14
15# Just variables, never passed in
16ARG TOMCAT=apache-tomcat-8.0.37
17ARG TOMCATTAR=${TOMCAT}.tar.gz
18ARG TOMCATHOME=/opt/${TOMCAT}
19ARG PORTALCONTEXT=ONAPPORTAL
20
21ENV http_proxy $HTTP_PROXY
22ENV https_proxy $HTTPS_PROXY
23RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
24 if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
25
26# Install Tomcat. This image already has curl.
27WORKDIR /tmp
28RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
29RUN tar -xzf ${TOMCATTAR}
30RUN rm ${TOMCATTAR}
31# Remove manager and sample apps
32RUN rm -fr ${TOMCAT}/webapps/[a-z]*
33RUN mkdir -p /opt
34RUN mv ${TOMCAT} /opt
35
36WORKDIR ${TOMCATHOME}/webapps
37RUN mkdir ${PORTALCONTEXT}
38
39# Portal has many parts
40COPY $PORTAL_WAR ${PORTALCONTEXT}
41RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
42COPY ${FE_DIR} ${PORTALCONTEXT}/public
43
44VOLUME ${TOMCATHOME}/logs
45
46# Switch back to root
47WORKDIR /
48
49# Define commonly used ENV variables
50ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
51# Install the launch script
52COPY start-apache-tomcat.sh /
53
54# Define default command
55CMD /start-apache-tomcat.sh