Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 1 | FROM alpine:3.8 |
| 2 | |
| 3 | LABEL maintainer="SDN-C Team (sdnc@lists.openecomp.org)" |
| 4 | ARG PIP_TAG=18.0 |
| 5 | |
| 6 | WORKDIR /opt/ |
| 7 | |
| 8 | COPY ansible-server/requirements.txt ansible-server/requirements.txt |
| 9 | |
Taka Cho | 9bec848 | 2019-02-18 14:31:27 -0500 | [diff] [blame] | 10 | RUN apk add --no-cache curl \ |
Taka Cho | ef127a5 | 2019-11-01 15:52:15 -0400 | [diff] [blame^] | 11 | iputils \ |
Taka Cho | 9bec848 | 2019-02-18 14:31:27 -0500 | [diff] [blame] | 12 | bash \ |
Taka Cho | ef127a5 | 2019-11-01 15:52:15 -0400 | [diff] [blame^] | 13 | py3-pip \ |
Sylvain Desbureaux | 78327d7 | 2019-03-05 17:40:10 +0100 | [diff] [blame] | 14 | openssh-client \ |
Taka Cho | ef127a5 | 2019-11-01 15:52:15 -0400 | [diff] [blame^] | 15 | python3 &&\ |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 16 | apk add --no-cache --virtual .build-deps build-base \ |
| 17 | libffi-dev \ |
| 18 | openssl-dev \ |
Taka Cho | ef127a5 | 2019-11-01 15:52:15 -0400 | [diff] [blame^] | 19 | python3-dev &&\ |
| 20 | pip3 install --no-cache-dir --upgrade pip==$PIP_TAG && \ |
| 21 | pip3 install --no-cache-dir -r ansible-server/requirements.txt &&\ |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 22 | apk del .build-deps |
| 23 | |
Timoney, Dan (dt5972) | 38e175f | 2019-02-21 14:57:34 -0500 | [diff] [blame] | 24 | RUN addgroup -S ansible && adduser -S ansible -G ansible |
Taka Cho | ef127a5 | 2019-11-01 15:52:15 -0400 | [diff] [blame^] | 25 | |
Timoney, Dan (dt5972) | 38e175f | 2019-02-21 14:57:34 -0500 | [diff] [blame] | 26 | COPY --chown=ansible:ansible ansible-server ansible-server |
| 27 | COPY --chown=ansible:ansible configuration/ansible.cfg /etc/ansible/ansible.cfg |
| 28 | |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 29 | WORKDIR /opt/ansible-server |
| 30 | |
Timoney, Dan (dt5972) | 15f406b | 2019-02-06 17:14:45 -0500 | [diff] [blame] | 31 | 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] | 32 | RUN echo > /var/log/ansible-server.log |
Taka Cho | c6e85bc | 2019-04-22 11:54:32 -0400 | [diff] [blame] | 33 | RUN chown -R ansible:ansible /var/log |
Sylvain Desbureaux | 78327d7 | 2019-03-05 17:40:10 +0100 | [diff] [blame] | 34 | RUN chown ansible:ansible /opt/ansible-server |
Timoney, Dan (dt5972) | 38e175f | 2019-02-21 14:57:34 -0500 | [diff] [blame] | 35 | |
| 36 | USER ansible:ansible |
| 37 | |
Timoney, Dan (dt5972) | 15f406b | 2019-02-06 17:14:45 -0500 | [diff] [blame] | 38 | |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 39 | EXPOSE 8000 |
| 40 | |
Taka Cho | 9bec848 | 2019-02-18 14:31:27 -0500 | [diff] [blame] | 41 | ##ENTRYPOINT ["python2", "RestServer.py"] |