aboutsummaryrefslogtreecommitdiffstats
path: root/workflow-designer-init
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2020-03-10 17:02:34 +0000
committerOfir Sonsino <os0695@intl.att.com>2020-03-18 12:04:58 +0200
commit822061760575f4b1327bb0b8e73d266ec9fbdba0 (patch)
tree6c8eb1bcbe3458db2a2a8fc489251531d6417c19 /workflow-designer-init
parentcdff1c49539736b0bf16c119ba158ff776a3d5c9 (diff)
Run pods as non-root user
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-2798 Change-Id: Ic50b8663f278b97185c471a4113de29b3e53e023
Diffstat (limited to 'workflow-designer-init')
-rw-r--r--workflow-designer-init/src/main/docker/Dockerfile15
1 files changed, 11 insertions, 4 deletions
diff --git a/workflow-designer-init/src/main/docker/Dockerfile b/workflow-designer-init/src/main/docker/Dockerfile
index b5ee15ad..656a84ca 100644
--- a/workflow-designer-init/src/main/docker/Dockerfile
+++ b/workflow-designer-init/src/main/docker/Dockerfile
@@ -1,12 +1,19 @@
FROM python:2.7-alpine3.8
-RUN pip install cqlsh==5.0.4 && \
- mkdir ~/.cassandra/ && \
+RUN pip install cqlsh==5.0.4
+
+RUN addgroup -g 1000 sdc && adduser -S -u 1000 -G sdc -s /bin/sh sdc
+USER sdc
+RUN mkdir ~/.cassandra/ && \
echo '[cql]' > ~/.cassandra/cqlshrc && \
echo 'version=3.4.4' >> ~/.cassandra/cqlshrc
+USER root
COPY create_keyspaces.cql create_tables.cql start.sh ./
+RUN chown sdc:sdc create_keyspaces.cql && \
+ chown sdc:sdc create_tables.cql && \
+ chown sdc:sdc start.sh && \
+ chmod 744 start.sh
-RUN chmod 744 start.sh
-
+USER sdc
ENTRYPOINT ["./start.sh"]