summaryrefslogtreecommitdiffstats
path: root/src/main/docker
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-02-15 18:33:19 +0100
committersebdet <sebastien.determe@intl.att.com>2019-02-15 18:33:19 +0100
commit9021eac53065669a5bb662f9f66c8c2fde9150de (patch)
tree5f0d9d4e465e943eaa6904810b4bbab6a00c1ed1 /src/main/docker
parentc6d3c50cb1c3b662c2481d31c7b91b9787bd1a29 (diff)
Run as non root
Modify the CLAMP docker image so that it does not run as root but as clamp user Issue-ID: CLAMP-298 Change-Id: I0bf7bed9cb76a2fcde72f2e23b66e03f03e5fe0e Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/main/docker')
-rw-r--r--src/main/docker/Dockerfile11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile
index 44e28094..983dea7d 100644
--- a/src/main/docker/Dockerfile
+++ b/src/main/docker/Dockerfile
@@ -15,10 +15,19 @@ RUN test -n "$http_proxy" && echo "Acquire::Proxy \"http://$http_proxy\";" > /et
apt-get -y dist-upgrade && \
apt-get install -y openjdk-8-jre-headless
+RUN groupadd -r onap && useradd --no-log-init -r -g onap clamp
+VOLUME /opt/clamp/config
+RUN mkdir /var/log/onap
+RUN chmod a+rwx /var/log/onap
+
COPY onap-clamp/clamp.jar /opt/clamp/app.jar
-VOLUME /etc
+RUN chmod 700 /opt/clamp/app.jar
+
COPY onap-clamp/startService.sh /opt/clamp/startService.sh
RUN chmod 700 /opt/clamp/startService.sh
+RUN chown -R clamp:onap /opt/clamp
+
+USER clamp
WORKDIR /opt/clamp/
ENTRYPOINT ./startService.sh