mmis | 461cafd | 2018-09-05 10:35:44 +0100 | [diff] [blame^] | 1 | FROM ubuntu:14.04 |
| 2 | |
| 3 | ARG HTTP_PROXY=${HTTP_PROXY} |
| 4 | ARG HTTPS_PROXY=${HTTPS_PROXY} |
| 5 | ARG BUILD_VERSION=${BUILD_VERSION} |
| 6 | ARG POLICY_LOGS=/var/log/onap |
| 7 | |
| 8 | ENV http_proxy $HTTP_PROXY |
| 9 | ENV https_proxy $HTTPS_PROXY |
| 10 | ENV BUILD_VERSION ${BUILD_VERSION} |
| 11 | ENV POLICY_LOGS ${POLICY_LOGS} |
| 12 | |
| 13 | ENV POLICY_HOME=/opt/app/policy |
| 14 | ENV POLICY_DISTRIBUTION_HOME=${POLICY_HOME}/distribution |
| 15 | |
| 16 | RUN \ |
| 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 | |
| 28 | RUN groupadd policy |
| 29 | RUN useradd --create-home --shell /bin/bash -g policy policy |
| 30 | |
| 31 | RUN mkdir -p ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS} && \ |
| 32 | chown policy:policy ${POLICY_HOME} ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS} |
| 33 | |
| 34 | RUN mkdir /packages |
| 35 | COPY /maven/* /packages |
| 36 | RUN tar xvfz /packages/policy-distribution.tar.gz --directory ${POLICY_DISTRIBUTION_HOME} |
| 37 | RUN rm /packages/policy-distribution.tar.gz |
| 38 | |
| 39 | WORKDIR ${POLICY_DISTRIBUTION_HOME} |
| 40 | COPY policy-dist.sh bin/. |
| 41 | RUN chown -R policy:policy * && chmod +x bin/*.sh |
| 42 | |
| 43 | USER policy |
| 44 | WORKDIR ${POLICY_DISTRIBUTION_HOME}/bin |
| 45 | ENTRYPOINT [ "bash", "./policy-dist.sh" ] |