ning.xi | 11319a1 | 2019-03-06 03:32:53 +0000 | [diff] [blame^] | 1 | FROM alpine:3.9 |
mmis | 461cafd | 2018-09-05 10:35:44 +0100 | [diff] [blame] | 2 | |
| 3 | ARG HTTP_PROXY=${HTTP_PROXY} |
| 4 | ARG HTTPS_PROXY=${HTTPS_PROXY} |
| 5 | ARG BUILD_VERSION=${BUILD_VERSION} |
ramverma | b5f4934 | 2019-02-05 15:34:35 +0000 | [diff] [blame] | 6 | ARG POLICY_LOGS=/var/log/onap/policy/distribution |
mmis | 461cafd | 2018-09-05 10:35:44 +0100 | [diff] [blame] | 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 | |
ning.xi | 11319a1 | 2019-03-06 03:32:53 +0000 | [diff] [blame^] | 16 | RUN apk add --no-cache --update busybox-extras bash zip unzip curl wget openssh openjdk8 maven jq httpie py-pip |
mmis | 461cafd | 2018-09-05 10:35:44 +0100 | [diff] [blame] | 17 | |
ning.xi | 11319a1 | 2019-03-06 03:32:53 +0000 | [diff] [blame^] | 18 | RUN addgroup -S policy && \ |
| 19 | adduser -S --shell /bin/bash -G policy policy |
mmis | 461cafd | 2018-09-05 10:35:44 +0100 | [diff] [blame] | 20 | |
ramverma | 48a7457 | 2019-02-07 12:02:07 +0000 | [diff] [blame] | 21 | RUN mkdir -p ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS} ${POLICY_HOME}/etc/ssl ${POLICY_DISTRIBUTION_HOME}/bin && \ |
liboNet | fc32c23 | 2018-12-18 09:22:00 +0800 | [diff] [blame] | 22 | chown -R policy:policy ${POLICY_HOME} ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS} |
mmis | 461cafd | 2018-09-05 10:35:44 +0100 | [diff] [blame] | 23 | |
| 24 | RUN mkdir /packages |
| 25 | COPY /maven/* /packages |
ning.xi | 11319a1 | 2019-03-06 03:32:53 +0000 | [diff] [blame^] | 26 | RUN tar xvfz /packages/policy-distribution.tar.gz --directory ${POLICY_DISTRIBUTION_HOME} \ |
| 27 | && rm /packages/policy-distribution.tar.gz |
mmis | 461cafd | 2018-09-05 10:35:44 +0100 | [diff] [blame] | 28 | |
| 29 | WORKDIR ${POLICY_DISTRIBUTION_HOME} |
| 30 | COPY policy-dist.sh bin/. |
ning.xi | 11319a1 | 2019-03-06 03:32:53 +0000 | [diff] [blame^] | 31 | RUN chown -R policy:policy * && chmod +x bin/*.sh \ |
| 32 | && cp ${POLICY_DISTRIBUTION_HOME}/etc/ssl/* ${POLICY_HOME}/etc/ssl && chown policy:policy ${POLICY_HOME}/etc/ssl/* |
mmis | 461cafd | 2018-09-05 10:35:44 +0100 | [diff] [blame] | 33 | |
| 34 | USER policy |
| 35 | WORKDIR ${POLICY_DISTRIBUTION_HOME}/bin |
| 36 | ENTRYPOINT [ "bash", "./policy-dist.sh" ] |