summaryrefslogtreecommitdiffstats
path: root/deliveries/src/main/docker/docker-files/Dockerfile
diff options
context:
space:
mode:
authorAmichai Hemli <amichai.hemli@intl.att.com>2020-02-24 17:34:23 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-24 17:34:23 +0000
commit7d10f76469786a5fb3a5f439a689bed688b09658 (patch)
treec4f9659c35ee2782f5193683b7d4c2d6ca5c1694 /deliveries/src/main/docker/docker-files/Dockerfile
parentd9d76be660584b7eca9d8b916b3974a0ea163905 (diff)
parent8f70f2a3586588c6be369756330633d24e4cfe6d (diff)
Merge changes Ia95e99f4,Iac2da615
* changes: Move to jdk11-openjdk-slim (was jre8-alpine) Maven import jakarta XML Binding
Diffstat (limited to 'deliveries/src/main/docker/docker-files/Dockerfile')
-rwxr-xr-xdeliveries/src/main/docker/docker-files/Dockerfile16
1 files changed, 12 insertions, 4 deletions
diff --git a/deliveries/src/main/docker/docker-files/Dockerfile b/deliveries/src/main/docker/docker-files/Dockerfile
index f6070d8b1..be6c08bc3 100755
--- a/deliveries/src/main/docker/docker-files/Dockerfile
+++ b/deliveries/src/main/docker/docker-files/Dockerfile
@@ -1,9 +1,17 @@
-FROM tomcat:9.0-jre8-alpine
+FROM tomcat:9-jdk11-openjdk-slim
# add vim and uncomment alias to speedup troubleshooting purpose
RUN apk update && apk add openjdk8 vim net-tools
-RUN adduser --disabled-password onap onap
+ARG user=onap
+ARG group=onap
+
+# Create a group and user
+RUN groupadd -r $group && useradd -ms /bin/bash $user -g $group && \
+ mkdir /opt/$user && \
+ chown -R $user:$group /opt/$user && \
+ mkdir /var/log/$user && \
+ chown -R $user:$group /var/log/$user
# MariaDB variables
ENV VID_MYSQL_HOST="vid-mariadb-docker-instance" \
@@ -87,7 +95,7 @@ ADD maven/config/server.xml ${VID_TOMCAT_PATH}
ADD maven/scripts/*.sh /tmp/vid/
ADD maven/artifacts/vid.war /tmp/vid/stage/
-RUN chown onap:onap /tmp/vid /usr/local/tomcat -R
+RUN chown $user:$group /tmp/vid /usr/local/tomcat -R
RUN chmod +x /tmp/vid/localize.sh
-USER onap
+USER $user
CMD ["/tmp/vid/localize.sh"]