summaryrefslogtreecommitdiffstats
path: root/models-sim/packages/models-simulator-docker/src/main/docker
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2022-07-01 12:52:00 +0100
committerdanielhanrahan <daniel.hanrahan@est.tech>2022-07-01 12:52:00 +0100
commitc8a0aa754a2acd4bd23da005dbc1595969e78b40 (patch)
tree819910c32b5bdc2b1ff178c76103cab36393b1f9 /models-sim/packages/models-simulator-docker/src/main/docker
parent8c8eb415ca57830d462cefbe8d659b3b98b6de7c (diff)
Fix simulator OpenSuse docker file
Follow the same conventions as other docker files and startup scripts Issue-ID: POLICY-4233 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I1a81864f430837e32eb8214e7862c0293b73e062
Diffstat (limited to 'models-sim/packages/models-simulator-docker/src/main/docker')
-rw-r--r--models-sim/packages/models-simulator-docker/src/main/docker/suse.Dockerfile33
1 files changed, 11 insertions, 22 deletions
diff --git a/models-sim/packages/models-simulator-docker/src/main/docker/suse.Dockerfile b/models-sim/packages/models-simulator-docker/src/main/docker/suse.Dockerfile
index 65e4783ab..e0fdd50a9 100644
--- a/models-sim/packages/models-simulator-docker/src/main/docker/suse.Dockerfile
+++ b/models-sim/packages/models-simulator-docker/src/main/docker/suse.Dockerfile
@@ -20,10 +20,6 @@
# ============LICENSE_END=========================================================
#
-#
-# Docker file to build an image that runs the simulators
-#
-
FROM opensuse/leap:15.3
LABEL maintainer="Policy Team"
@@ -39,34 +35,27 @@ LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
ARG POLICY_LOGS=/var/log/onap/policy/simulators
ENV POLICY_LOGS=$POLICY_LOGS
-ENV POLICY_HOME=/opt/app/policy
+ENV POLICY_HOME=/opt/app/policy/simulators
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
-# Create DMaaP simulator user and group
-# Add simulator-specific directories and set ownership as the simulator user
RUN zypper -n -q install --no-recommends gzip java-11-openjdk-headless netcat-openbsd tar && \
zypper -n -q update; zypper -n -q clean --all && \
groupadd --system policy && \
useradd --system --shell /bin/sh -G policy policy && \
- mkdir -p /opt/app $POLICY_LOGS $POLICY_HOME/simulators $POLICY_HOME/simulators/bin && \
- chown -R policy:policy /opt/app $POLICY_HOME $POLICY_LOGS && \
+ mkdir -p /app $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \
+ chown -R policy:policy /app $POLICY_HOME $POLICY_LOGS && \
mkdir /packages
+COPY /maven/lib/models-simulator.tar.gz /packages
-# Unpack the tarball
-COPY /maven/* /packages
-RUN tar xvfz /packages/models-simulator.tar.gz --directory ${POLICY_HOME}/simulators \
+RUN tar xvfz /packages/models-simulator.tar.gz --directory ${POLICY_HOME} \
&& rm /packages/models-simulator.tar.gz
-# Ensure everything has the correct permissions
-# Copy scripts simulator user area
-COPY simulators.sh ${POLICY_HOME}/simulators/bin
-RUN find /opt/app -type d -perm 755 \
- && find /opt/app -type f -perm 644 \
- && chmod 755 ${POLICY_HOME}/simulators/bin/* \
- && chown -R policy:policy $POLICY_HOME $POLICY_LOGS
+WORKDIR $POLICY_HOME
+COPY simulators.sh bin/.
-USER policy:policy
+RUN chown -R policy:policy * && chmod 755 bin/*.sh && chown -R policy:policy /app
-ENV PATH ${POLICY_HOME}/simulators/bin:$PATH
-ENTRYPOINT [ "simulators.sh" ]
+USER policy
+WORKDIR $POLICY_HOME/bin
+ENTRYPOINT [ "./simulators.sh" ]