blob: 0d4b3b91c1729e625a5b95396917022a1940a502 [file] [log] [blame]
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -05001FROM 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/policy/api
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_API_HOME=${POLICY_HOME}/api
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_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
34RUN mkdir /packages
35COPY /maven/* /packages
36RUN tar xvfz /packages/policy-api.tar.gz --directory ${POLICY_API_HOME}
37RUN rm /packages/policy-api.tar.gz
38
39WORKDIR ${POLICY_API_HOME}
40COPY policy-api.sh bin/.
41RUN chown -R policy:policy * && chmod +x bin/*.sh
42RUN cp ${POLICY_API_HOME}/etc/ssl/* ${POLICY_HOME}/etc/ssl && chown policy:policy ${POLICY_HOME}/etc/ssl/*
43
44USER policy
45WORKDIR ${POLICY_API_HOME}/bin
46ENTRYPOINT [ "bash", "./policy-api.sh" ]