aboutsummaryrefslogtreecommitdiffstats
path: root/packages/policy-pap-docker/src/main/docker/Dockerfile
diff options
context:
space:
mode:
authorramverma <ram.krishna.verma@est.tech>2019-02-11 15:20:09 +0000
committerramverma <ram.krishna.verma@est.tech>2019-02-11 15:20:09 +0000
commitd1a702ca63adfd763bcc2e0aa1f71131bbc73308 (patch)
treec98147e092bcb83b3b220decd724595da80fae73 /packages/policy-pap-docker/src/main/docker/Dockerfile
parent74ead72904c6c9240dbfcf6d86433e32510416f6 (diff)
Creating package & docker image of policy/pap
1) Creating zip package of entire policy pap. 2) Creating docker image of policy pap. Change-Id: I41bd705966e75e9cf501154da71f90d11ff2b3e1 Issue-ID: POLICY-1478 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
Diffstat (limited to 'packages/policy-pap-docker/src/main/docker/Dockerfile')
-rw-r--r--packages/policy-pap-docker/src/main/docker/Dockerfile46
1 files changed, 46 insertions, 0 deletions
diff --git a/packages/policy-pap-docker/src/main/docker/Dockerfile b/packages/policy-pap-docker/src/main/docker/Dockerfile
new file mode 100644
index 00000000..727cab28
--- /dev/null
+++ b/packages/policy-pap-docker/src/main/docker/Dockerfile
@@ -0,0 +1,46 @@
+FROM ubuntu:16.04
+
+ARG HTTP_PROXY=${HTTP_PROXY}
+ARG HTTPS_PROXY=${HTTPS_PROXY}
+ARG BUILD_VERSION=${BUILD_VERSION}
+ARG POLICY_LOGS=/var/log/onap/policy/pap
+
+ENV http_proxy $HTTP_PROXY
+ENV https_proxy $HTTPS_PROXY
+ENV BUILD_VERSION ${BUILD_VERSION}
+ENV POLICY_LOGS ${POLICY_LOGS}
+
+ENV POLICY_HOME=/opt/app/policy
+ENV POLICY_PAP_HOME=${POLICY_HOME}/pap
+
+RUN \
+ apt-get clean && \
+ apt-get update && \
+ apt-get install -y zip unzip curl wget ssh telnet maven && \
+ apt-get install -y software-properties-common && \
+ apt-get install -y jq httpie && \
+ apt-get install -y python-pip && \
+ add-apt-repository ppa:openjdk-r/ppa && \
+ apt-get clean && \
+ apt-get update && \
+ apt-get install -y openjdk-8-jdk
+
+RUN groupadd policy
+RUN useradd --create-home --shell /bin/bash -g policy policy
+
+RUN mkdir -p ${POLICY_PAP_HOME} ${POLICY_LOGS} ${POLICY_HOME}/etc/ssl ${POLICY_PAP_HOME}/bin && \
+ chown -R policy:policy ${POLICY_HOME} ${POLICY_PAP_HOME} ${POLICY_LOGS}
+
+RUN mkdir /packages
+COPY /maven/* /packages
+RUN tar xvfz /packages/policy-pap.tar.gz --directory ${POLICY_PAP_HOME}
+RUN rm /packages/policy-pap.tar.gz
+
+WORKDIR ${POLICY_PAP_HOME}
+COPY policy-pap.sh bin/.
+RUN chown -R policy:policy * && chmod +x bin/*.sh
+RUN cp ${POLICY_PAP_HOME}/etc/ssl/* ${POLICY_HOME}/etc/ssl && chown policy:policy ${POLICY_HOME}/etc/ssl/*
+
+USER policy
+WORKDIR ${POLICY_PAP_HOME}/bin
+ENTRYPOINT [ "bash", "./policy-pap.sh" ]