blob: da2eceb0dfd179b44a53fb386bf535c5606aa915 [file] [log] [blame]
ning.xi11319a12019-03-06 03:32:53 +00001FROM alpine:3.9
mmis461cafd2018-09-05 10:35:44 +01002
3ARG HTTP_PROXY=${HTTP_PROXY}
4ARG HTTPS_PROXY=${HTTPS_PROXY}
5ARG BUILD_VERSION=${BUILD_VERSION}
ramvermab5f49342019-02-05 15:34:35 +00006ARG POLICY_LOGS=/var/log/onap/policy/distribution
mmis461cafd2018-09-05 10:35:44 +01007
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
ning.xi11319a12019-03-06 03:32:53 +000016RUN apk add --no-cache --update busybox-extras bash zip unzip curl wget openssh openjdk8 maven jq httpie py-pip
mmis461cafd2018-09-05 10:35:44 +010017
ning.xi11319a12019-03-06 03:32:53 +000018RUN addgroup -S policy && \
19 adduser -S --shell /bin/bash -G policy policy
mmis461cafd2018-09-05 10:35:44 +010020
ramverma48a74572019-02-07 12:02:07 +000021RUN mkdir -p ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS} ${POLICY_HOME}/etc/ssl ${POLICY_DISTRIBUTION_HOME}/bin && \
liboNetfc32c232018-12-18 09:22:00 +080022 chown -R policy:policy ${POLICY_HOME} ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS}
mmis461cafd2018-09-05 10:35:44 +010023
24RUN mkdir /packages
25COPY /maven/* /packages
ning.xi11319a12019-03-06 03:32:53 +000026RUN tar xvfz /packages/policy-distribution.tar.gz --directory ${POLICY_DISTRIBUTION_HOME} \
27 && rm /packages/policy-distribution.tar.gz
mmis461cafd2018-09-05 10:35:44 +010028
29WORKDIR ${POLICY_DISTRIBUTION_HOME}
30COPY policy-dist.sh bin/.
ning.xi11319a12019-03-06 03:32:53 +000031RUN 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/*
mmis461cafd2018-09-05 10:35:44 +010033
34USER policy
35WORKDIR ${POLICY_DISTRIBUTION_HOME}/bin
36ENTRYPOINT [ "bash", "./policy-dist.sh" ]