From a2abf6ea18d512d367277bacaf7476754dc0eff5 Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Tue, 10 Mar 2020 12:37:48 +0000 Subject: Run pods as non-root user Summary of changes: sdc-cassandra-init Added user sdc (in base image base_sdc-cqlsh - https://gerrit.onap.org/r/103436) Run entrypoint as user sdc Moved relevant files from /root/ to /home/sdc/ sdc-backend-init Added user sdc (in base image base_sdc-python - https://gerrit.onap.org/r/103436) Run entrypoint as user sdc Moved relevant files from /root/ to /home/sdc/ sdc-backend Run entrypoint as user jetty Moved relevant files from /root/ to /var/lib/jetty/ Moved cadi & cert files from /opt/app/jetty to /var/lib/jetty/ Moved ready_probe from /var/lib/read-probe.sh to /var/lib/jetty/read-probe.sh sdc-frontend Run entrypoint as user jetty Moved relevant files from /root/ to /var/lib/jetty/ Moved ready_probe from /var/lib/read-probe.sh to /var/lib/jetty/read-probe.sh sdc-onboard-backend-docker Run entrypoint as user jetty Moved relevant files from /root/ to /var/lib/jetty/ Moved ready_probe from /var/lib/read-probe.sh to /var/lib/jetty/read-probe.sh sdc-onboard-db-init-docker Run entrypoint as user sdc Added user sdc (in base image base_sdc-cqlsh - https://gerrit.onap.org/r/103436) Moved relevant files from /root/ to /home/sdc/ Signed-off-by: MichaelMorris Issue-ID: SDC-2798 Change-Id: I85be320a4a5e1cc5aeebbb98c4484d5d6fd06dfc --- .../dist/sdc-onboard-db-init-docker/artifacts/Dockerfile | 15 +++++++-------- .../dist/sdc-onboard-db-init-docker/artifacts/startup.sh | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'openecomp-be/dist/sdc-onboard-db-init-docker/artifacts') diff --git a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile index 29189dbb4c..8dfc8a86f5 100644 --- a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile +++ b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile @@ -1,14 +1,13 @@ -FROM onap/base_sdc-cqlsh:1.5.0-SNAPSHOT-latest +FROM onap/base_sdc-cqlsh:1.6.0-SNAPSHOT-latest -COPY init_keyspaces.cql /root/ +COPY --chown=sdc:sdc init_keyspaces.cql /home/sdc/ -COPY init_schemas.cql /root/ +COPY --chown=sdc:sdc init_schemas.cql /home/sdc/ -COPY alter_tables.cql /root/ +COPY --chown=sdc:sdc alter_tables.cql /home/sdc/ -COPY startup.sh /root/ +COPY --chown=sdc:sdc startup.sh /home/sdc/ -RUN chmod 770 /root/startup.sh - -ENTRYPOINT [ "/root/startup.sh" ] +RUN chmod 770 /home/sdc/startup.sh +ENTRYPOINT [ "/home/sdc/startup.sh" ] diff --git a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh index 02354dbd6e..2f398b2f91 100644 --- a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh +++ b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh @@ -1,6 +1,6 @@ #!/bin/bash -cd /root +cd /home/sdc CS_PORT="" CS_HOST=127.0.0.1 -- cgit 1.2.3-korg