blob: e134977556d4ea080cf7e67d6cefbc48fa96cb83 [file] [log] [blame]
mmis461cafd2018-09-05 10:35:44 +01001FROM ubuntu:14.04
2
3ARG HTTP_PROXY=${HTTP_PROXY}
4ARG HTTPS_PROXY=${HTTPS_PROXY}
5ARG BUILD_VERSION=${BUILD_VERSION}
6ARG POLICY_LOGS=/var/log/onap
7
8ENV http_proxy $HTTP_PROXY
9ENV https_proxy $HTTPS_PROXY
10ENV BUILD_VERSION ${BUILD_VERSION}
11ENV POLICY_LOGS ${POLICY_LOGS}
12
13ENV POLICY_HOME=/opt/app/policy
14ENV POLICY_DISTRIBUTION_HOME=${POLICY_HOME}/distribution
15
16RUN \
17 apt-get clean && \
18 apt-get update && \
19 apt-get install -y zip unzip curl wget ssh telnet maven && \
20 apt-get install -y software-properties-common && \
21 apt-get install -y jq httpie && \
22 apt-get install -y python-pip && \
23 add-apt-repository ppa:openjdk-r/ppa && \
24 apt-get clean && \
25 apt-get update && \
26 apt-get install -y openjdk-8-jdk
27
28RUN groupadd policy
29RUN useradd --create-home --shell /bin/bash -g policy policy
30
31RUN mkdir -p ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS} && \
32 chown policy:policy ${POLICY_HOME} ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS}
33
34RUN mkdir /packages
35COPY /maven/* /packages
36RUN tar xvfz /packages/policy-distribution.tar.gz --directory ${POLICY_DISTRIBUTION_HOME}
37RUN rm /packages/policy-distribution.tar.gz
38
39WORKDIR ${POLICY_DISTRIBUTION_HOME}
40COPY policy-dist.sh bin/.
41RUN chown -R policy:policy * && chmod +x bin/*.sh
42
43USER policy
44WORKDIR ${POLICY_DISTRIBUTION_HOME}/bin
45ENTRYPOINT [ "bash", "./policy-dist.sh" ]