diff options
author | Kotagiri, Ramprasad (rp5662) <rp5662@att.com> | 2020-08-21 08:40:37 -0400 |
---|---|---|
committer | Kotagiri, Ramprasad (rp5662) <rp5662@att.com> | 2020-08-21 08:52:29 -0400 |
commit | 47b65efd69c5158d958261846803d2e15adfb448 (patch) | |
tree | d0f3752b551a31cf39a36cbee16392bbcc36c72b /ccsdk-app-os/Dockerfile | |
parent | c32511155acad5b70dcc3cf29e9bfa36276f3894 (diff) |
java 11 upgrade and sonar scan fixes
Recompile java source code using jdk11
Run in ojdk11 JRE
tomcat container upgrade
alpine base image
Issue-ID: DCAEGEN2-2298
Change-Id: Ic4bf2626e5805508589cafe52b7c4e91d7ae3580
Signed-off-by: Kotagiri, Ramprasad (rp5662) <rp5662@att.com>
Diffstat (limited to 'ccsdk-app-os/Dockerfile')
-rw-r--r-- | ccsdk-app-os/Dockerfile | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/ccsdk-app-os/Dockerfile b/ccsdk-app-os/Dockerfile index 7c1769e..877f62f 100644 --- a/ccsdk-app-os/Dockerfile +++ b/ccsdk-app-os/Dockerfile @@ -1,30 +1,37 @@ -# Use an official Tomcat base image -FROM tomcat:8 +FROM adoptopenjdk/openjdk11:jre-11.0.8_10-alpine +#FROM tomcat:jdk11-adoptopenjdk-openj9 -ENV APPDIR /usr/local/tomcat -ENV APPUSER dash +USER root +ENV CATALINA_HOME /usr/local/tomcat +ENV PATH $CATALINA_HOME/bin:$PATH COPY docker-dashboard-installation.sh /tmp/docker-dashboard-installation.sh COPY create_table.sql /tmp/create_table.sql +COPY target/ccsdk*.war /tmp/ccsdk-app.war -RUN mkdir /home/deployments \ +ARG user=onap +ARG group=onap + +RUN apk update \ + && apk add wget zip dos2unix postgresql \ + && wget -q http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.37/bin/apache-tomcat-9.0.37.tar.gz \ + && tar -xzf apache-tomcat-9.0.37.tar.gz \ + && rm -f apache-tomcat-9.0.37.tar.gz \ + && rm -fr apache-tomcat-9.0.37/webapps/[a-z]* \ + && mkdir -p ${CATALINA_HOME} \ + && mv apache-tomcat-9.0.37/* ${CATALINA_HOME} \ && mkdir -p /opt/logs/dcae/dashboard \ - && useradd -u 1000 -M -U ${APPUSER} \ - && chown -R 1000:1000 ${APPDIR} \ - && chown -R 1000:1000 /home/deployments \ - && chown -R 1000:1000 /opt/logs/dcae/dashboard \ - && apt-get update \ - && apt-get install -y sudo zip vim dos2unix postgresql \ - && echo "dash ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/dash_update_cert_store \ && dos2unix /tmp/create_table.sql \ && dos2unix /tmp/docker-dashboard-installation.sh \ && chmod +x /tmp/create_table.sql \ - && chmod +x /tmp/docker-dashboard-installation.sh - -ARG WAR_FILE -COPY target/${WAR_FILE} /home/deployments/ccsdk-app.war + && chmod +x /tmp/docker-dashboard-installation.sh \ + && addgroup -S $group && adduser -G $group -D $user \ + && chown -R $user:$group ${CATALINA_HOME} \ + && chown -R $user:$group /tmp \ + && chown -R $user:$group /opt/logs/dcae/dashboard -WORKDIR ${APPDIR} -USER ${APPUSER} +USER ${user} +WORKDIR $CATALINA_HOME -CMD ["/tmp/docker-dashboard-installation.sh"] +ENTRYPOINT /tmp/docker-dashboard-installation.sh +#CMD ["/tmp/docker-dashboard-installation.sh"] |