aboutsummaryrefslogtreecommitdiffstats
path: root/cmso-database/src/main
diff options
context:
space:
mode:
authorvrvarma <vikas.varma@att.com>2020-03-05 11:13:48 -0500
committervrvarma <vikas.varma@att.com>2020-03-05 11:13:58 -0500
commitbcc32d6305104ecfd054f8223fc4d667319590a5 (patch)
tree1e377964e3e5711115fb680bb9b0dd3df9d03a3f /cmso-database/src/main
parentbb21f15fa12db8ebb39c3aadd8a0a34aa7fa1b01 (diff)
making cmso pods run as non-root user
Change-Id: I0cd576964077038790b302d38e48c52da2867546 Signed-off-by: vrvarma <vikas.varma@att.com> Issue-ID: OPTFRA-711
Diffstat (limited to 'cmso-database/src/main')
-rw-r--r--cmso-database/src/main/docker/Dockerfile8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmso-database/src/main/docker/Dockerfile b/cmso-database/src/main/docker/Dockerfile
index 35fb4cc..8c4074c 100644
--- a/cmso-database/src/main/docker/Dockerfile
+++ b/cmso-database/src/main/docker/Dockerfile
@@ -17,15 +17,21 @@ RUN test -n "$http_proxy" && echo "Acquire::Proxy \"http://$http_proxy\";" > /et
apt-get install -y openjdk-11-jre-headless && \
apt-get install -y curl
+RUN groupadd onap \
+ && useradd -m -g onap onap
+
COPY onap-cmso/docker-liquibase.jar ${APP_HOME}/app.jar
COPY onap-cmso/startService.sh ${APP_HOME}/startService.sh
RUN chmod 700 ${APP_HOME}/startService.sh && \
ln -s /share/etc ${APP_HOME}/etc && \
- ln -s /share/logs ${APP_HOME}/logs
+ ln -s /share/logs ${APP_HOME}/logs && \
+ chown -R onap:onap ${APP_HOME}
VOLUME /share/etc
VOLUME /share/logs
+USER onap
+
WORKDIR ${APP_HOME}
ENTRYPOINT ./startService.sh