summaryrefslogtreecommitdiffstats
path: root/packages/apex-pdp-docker/src/main/docker/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'packages/apex-pdp-docker/src/main/docker/Dockerfile')
-rw-r--r--packages/apex-pdp-docker/src/main/docker/Dockerfile25
1 files changed, 9 insertions, 16 deletions
diff --git a/packages/apex-pdp-docker/src/main/docker/Dockerfile b/packages/apex-pdp-docker/src/main/docker/Dockerfile
index d8b547760..08bcddb05 100644
--- a/packages/apex-pdp-docker/src/main/docker/Dockerfile
+++ b/packages/apex-pdp-docker/src/main/docker/Dockerfile
@@ -20,9 +20,11 @@
# ============LICENSE_END=========================================================
#-------------------------------------------------------------------------------
-#
-# Docker file to build an image that runs APEX on Java 11 or better in alpine
-#
+FROM busybox AS tarball
+RUN mkdir /packages /extracted
+COPY /maven/apex-pdp-package-full.tar.gz /packages/
+RUN tar xvzf /packages/apex-pdp-package-full.tar.gz --directory /extracted/
+
FROM onap/policy-jdk-alpine:2.4.3
LABEL maintainer="Policy Team"
@@ -44,20 +46,11 @@ RUN apk update \
vim \
iputils \
&& addgroup -S apexuser && adduser -S apexuser -G apexuser \
- && mkdir -p $POLICY_HOME \
- && mkdir -p $POLICY_LOGS \
- && chown -R apexuser:apexuser $POLICY_LOGS \
- && mkdir /packages
+ && mkdir -p $POLICY_HOME $POLICY_LOGS \
+ && chown -R apexuser:apexuser $POLICY_HOME $POLICY_LOGS
-COPY /maven/apex-pdp-package-full.tar.gz /packages
-RUN tar xvfz /packages/apex-pdp-package-full.tar.gz --directory $POLICY_HOME \
- && rm /packages/apex-pdp-package-full.tar.gz \
- && find /opt/app -type d -perm 755 \
- && find /opt/app -type f -perm 644 \
- && chmod 755 $POLICY_HOME/bin/* \
- && cp -pr $POLICY_HOME/examples /home/apexuser \
- && chown -R apexuser:apexuser /home/apexuser/* $POLICY_HOME \
- && chmod 755 $POLICY_HOME/etc/*
+COPY --chown=apexuser:apexuser --from=tarball /extracted $POLICY_HOME
+RUN cp -pr $POLICY_HOME/examples /home/apexuser
USER apexuser
ENV PATH $POLICY_HOME/bin:$PATH