Dan Timoney | 0b9839e | 2020-09-01 16:21:53 -0400 | [diff] [blame] | 1 | FROM onap/integration-python:7.0.1 |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 2 | |
| 3 | LABEL maintainer="SDN-C Team (sdnc@lists.openecomp.org)" |
| 4 | ARG PIP_TAG=18.0 |
| 5 | |
| 6 | WORKDIR /opt/ |
| 7 | |
Dan Timoney | 0b9839e | 2020-09-01 16:21:53 -0400 | [diff] [blame] | 8 | ENV http_proxy ${http_proxy} |
| 9 | ENV https_proxy ${https_proxy} |
| 10 | ENV PIP_EXTRA_OPTS ${https_proxy:+"--trusted-host pypi.org --trusted-host files.pythonhosted.org --proxy=${https_proxy}"} |
| 11 | ENV PIP_EXTRA_OPTS ${PIP_EXTRA_OPTS:-""} |
| 12 | |
| 13 | USER root |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 14 | COPY ansible-server/requirements.txt ansible-server/requirements.txt |
| 15 | |
Dan Timoney | 0b9839e | 2020-09-01 16:21:53 -0400 | [diff] [blame] | 16 | RUN echo "https_proxy is ${https_proxy} ; PIP_EXTRA_OPTS is ${PIP_EXTRA_OPTS}" |
| 17 | |
Taka Cho | 9bec848 | 2019-02-18 14:31:27 -0500 | [diff] [blame] | 18 | RUN apk add --no-cache curl \ |
Taka Cho | ef127a5 | 2019-11-01 15:52:15 -0400 | [diff] [blame] | 19 | iputils \ |
Taka Cho | 9bec848 | 2019-02-18 14:31:27 -0500 | [diff] [blame] | 20 | bash \ |
Dan Timoney | 0b9839e | 2020-09-01 16:21:53 -0400 | [diff] [blame] | 21 | openssh-client &&\ |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 22 | apk add --no-cache --virtual .build-deps build-base \ |
| 23 | libffi-dev \ |
| 24 | openssl-dev \ |
Taka Cho | ef127a5 | 2019-11-01 15:52:15 -0400 | [diff] [blame] | 25 | python3-dev &&\ |
Dan Timoney | 0b9839e | 2020-09-01 16:21:53 -0400 | [diff] [blame] | 26 | pip3 install --no-cache-dir --upgrade pip ${PIP_EXTRA_OPTS} && \ |
| 27 | pip3 install --no-cache-dir -r ansible-server/requirements.txt ${PIP_EXTRA_OPTS} &&\ |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 28 | apk del .build-deps |
| 29 | |
Timoney, Dan (dt5972) | 38e175f | 2019-02-21 14:57:34 -0500 | [diff] [blame] | 30 | RUN addgroup -S ansible && adduser -S ansible -G ansible |
Taka Cho | ef127a5 | 2019-11-01 15:52:15 -0400 | [diff] [blame] | 31 | |
Timoney, Dan (dt5972) | 38e175f | 2019-02-21 14:57:34 -0500 | [diff] [blame] | 32 | COPY --chown=ansible:ansible ansible-server ansible-server |
| 33 | COPY --chown=ansible:ansible configuration/ansible.cfg /etc/ansible/ansible.cfg |
| 34 | |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 35 | WORKDIR /opt/ansible-server |
| 36 | |
Timoney, Dan (dt5972) | 15f406b | 2019-02-06 17:14:45 -0500 | [diff] [blame] | 37 | RUN mkdir /opt/onap ; ln -s /opt/ansible-server /opt/onap/ccsdk |
Timoney, Dan (dt5972) | 38e175f | 2019-02-21 14:57:34 -0500 | [diff] [blame] | 38 | RUN echo > /var/log/ansible-server.log |
Taka Cho | c6e85bc | 2019-04-22 11:54:32 -0400 | [diff] [blame] | 39 | RUN chown -R ansible:ansible /var/log |
Sylvain Desbureaux | 78327d7 | 2019-03-05 17:40:10 +0100 | [diff] [blame] | 40 | RUN chown ansible:ansible /opt/ansible-server |
Timoney, Dan (dt5972) | 38e175f | 2019-02-21 14:57:34 -0500 | [diff] [blame] | 41 | |
| 42 | USER ansible:ansible |
| 43 | |
Timoney, Dan (dt5972) | 15f406b | 2019-02-06 17:14:45 -0500 | [diff] [blame] | 44 | |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 45 | EXPOSE 8000 |
| 46 | |
Taka Cho | 9bec848 | 2019-02-18 14:31:27 -0500 | [diff] [blame] | 47 | ##ENTRYPOINT ["python2", "RestServer.py"] |