Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [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/policy/api |
| 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_API_HOME=${POLICY_HOME}/api |
| 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_API_HOME} ${POLICY_LOGS} ${POLICY_HOME}/etc/ssl ${POLICY_API_HOME}/bin && \ |
| 32 | chown -R policy:policy ${POLICY_HOME} ${POLICY_API_HOME} ${POLICY_LOGS} |
| 33 | |
| 34 | RUN mkdir /packages |
| 35 | COPY /maven/* /packages |
| 36 | RUN tar xvfz /packages/policy-api.tar.gz --directory ${POLICY_API_HOME} |
| 37 | RUN rm /packages/policy-api.tar.gz |
| 38 | |
| 39 | WORKDIR ${POLICY_API_HOME} |
| 40 | COPY policy-api.sh bin/. |
| 41 | RUN chown -R policy:policy * && chmod +x bin/*.sh |
| 42 | RUN cp ${POLICY_API_HOME}/etc/ssl/* ${POLICY_HOME}/etc/ssl && chown policy:policy ${POLICY_HOME}/etc/ssl/* |
| 43 | |
| 44 | USER policy |
| 45 | WORKDIR ${POLICY_API_HOME}/bin |
| 46 | ENTRYPOINT [ "bash", "./policy-api.sh" ] |