aboutsummaryrefslogtreecommitdiffstats
path: root/packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile')
-rw-r--r--packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile28
1 files changed, 12 insertions, 16 deletions
diff --git a/packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile b/packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile
index a521d0425..992735855 100644
--- a/packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile
+++ b/packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile
@@ -18,9 +18,11 @@
# ============LICENSE_END=========================================================
#-------------------------------------------------------------------------------
-#
-# Docker file to build an image that runs the CLAMP ACM runtime on Java 11 or better in OpenSuse
-#
+FROM busybox AS tarball
+RUN mkdir /packages /extracted
+COPY /maven/lib/policy-clamp-runtime-acm.tar.gz /packages/
+RUN tar xvzf /packages/policy-clamp-runtime-acm.tar.gz --directory /extracted/
+
FROM opensuse/leap:15.4
LABEL maintainer="Policy Team"
@@ -40,26 +42,20 @@ ENV POLICY_HOME=/opt/app/policy/clamp
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
-RUN zypper -n -q install --no-recommends gzip java-11-openjdk-headless netcat-openbsd tar && \
+RUN zypper -n -q install --no-recommends java-11-openjdk-headless netcat-openbsd && \
zypper -n -q update && zypper -n -q clean --all && \
groupadd --system policy && \
useradd --system --shell /bin/sh -G policy policy && \
- mkdir -p /app $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \
- chown -R policy:policy /app $POLICY_HOME $POLICY_LOGS && \
- mkdir /packages
-
-COPY /maven/lib/policy-clamp-runtime-acm.tar.gz /packages
+ mkdir -p $POLICY_HOME $POLICY_LOGS && \
+ chown -R policy:policy $POLICY_HOME $POLICY_LOGS
-RUN tar xvfz /packages/policy-clamp-runtime-acm.tar.gz --directory $POLICY_HOME && \
- rm /packages/policy-clamp-runtime-acm.tar.gz
+COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
WORKDIR $POLICY_HOME
-COPY acm-runtime.sh bin/.
-COPY /maven/policy-clamp-runtime-acm.jar /app/app.jar
+COPY --chown=policy:policy acm-runtime.sh bin/
+COPY --chown=policy:policy /maven/policy-clamp-runtime-acm.jar /app/app.jar
-RUN chown -R policy:policy * && \
- chmod 755 bin/*.sh && \
- chown -R policy:policy /app
+RUN chmod 755 bin/*.sh
EXPOSE 6969