aboutsummaryrefslogtreecommitdiffstats
path: root/packages/apex-pdp-docker/src
diff options
context:
space:
mode:
authorDmitry Puzikov <dmitry.puzikov@tieto.com>2019-03-25 10:47:23 +0100
committerDmitry Puzikov <dmitry.puzikov@tieto.com>2019-04-30 09:24:50 +0200
commit1aac864b4f4c9fb0c923d4b873b920fb6d7dd602 (patch)
tree57f72b2782a04dd2c67c8761c7efe79c71d78f97 /packages/apex-pdp-docker/src
parentca558cfb1ea47de081527771af47abb37a8cd964 (diff)
Rebase image on policy-base-alpine
Issue-ID: INT-997 Change-Id: I1a39eaf9cc0fc546eafde10d0b81a90ed5d32b13 Signed-off-by: Dmitry Puzikov <dmitry.puzikov@tieto.com>
Diffstat (limited to 'packages/apex-pdp-docker/src')
-rw-r--r--packages/apex-pdp-docker/src/main/docker/Dockerfile41
1 files changed, 26 insertions, 15 deletions
diff --git a/packages/apex-pdp-docker/src/main/docker/Dockerfile b/packages/apex-pdp-docker/src/main/docker/Dockerfile
index f0318de2a..bd9052cce 100644
--- a/packages/apex-pdp-docker/src/main/docker/Dockerfile
+++ b/packages/apex-pdp-docker/src/main/docker/Dockerfile
@@ -1,36 +1,47 @@
#
# Docker file to build an image that runs APEX on Java 8 in alpine
#
-FROM alpine:3.9
+FROM onap/policy-base-alpine
-RUN apk add --no-cache --update bash nss procps coreutils findutils grep zip unzip \
- curl wget openssh iproute2 iputils vim openjdk8
+LABEL maintainer="Policy Team"
+
+ARG BUILD_VERSION=${BUILD_VERSION}
+ARG POLICY_LOGS=/var/log/onap/policy/apex-pdp
+
+ENV BUILD_VERSION ${BUILD_VERSION}
+ENV POLICY_HOME=/opt/app/policy
+ENV POLICY_APEX_PDP_HOME=${POLICY_HOME}/apex-pdp
+ENV POLICY_LOGS=${POLICY_LOGS}
+
+RUN apk add --no-cache \
+ vim \
+ iproute2 \
+ iputils
# Create apex user and group
RUN addgroup -S apexuser && adduser -S apexuser -G apexuser
# Add Apex-specific directories and set ownership as the Apex admin user
-RUN mkdir -p /opt/app/policy/apex-pdp
-RUN mkdir -p /var/log/onap/policy/apex-pdp
-RUN chown -R apexuser:apexuser /var/log/onap/policy/apex-pdp
+RUN mkdir -p ${POLICY_APEX_PDP_HOME} \
+ && mkdir -p ${POLICY_LOGS} \
+ && chown -R apexuser:apexuser ${POLICY_LOGS}
# Unpack the tarball
RUN mkdir /packages
COPY apex-pdp-package-full.tar.gz /packages
-RUN tar xvfz /packages/apex-pdp-package-full.tar.gz --directory /opt/app/policy/apex-pdp
-RUN rm /packages/apex-pdp-package-full.tar.gz
+RUN tar xvfz /packages/apex-pdp-package-full.tar.gz --directory ${POLICY_APEX_PDP_HOME} \
+ && rm /packages/apex-pdp-package-full.tar.gz
# Ensure everything has the correct permissions
-RUN find /opt/app -type d -perm 755
-RUN find /opt/app -type f -perm 644
-RUN chmod a+x /opt/app/policy/apex-pdp/bin/*
+RUN find /opt/app -type d -perm 755 \
+ && find /opt/app -type f -perm 644 \
+ && chmod a+x ${POLICY_APEX_PDP_HOME}/bin/*
# Copy examples to Apex user area
-RUN cp -pr /opt/app/policy/apex-pdp/examples /home/apexuser
-
-RUN chown -R apexuser:apexuser /home/apexuser/*
+RUN cp -pr ${POLICY_APEX_PDP_HOME}/examples /home/apexuser \
+ && chown -R apexuser:apexuser /home/apexuser/*
USER apexuser
-ENV PATH /opt/app/policy/apex-pdp/bin:$PATH
+ENV PATH ${POLICY_APEX_PDP_HOME}/bin:$PATH
WORKDIR /home/apexuser