blob: 2751a48213e628f10631e251ed11e45c04f8466f [file] [log] [blame]
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +01001FROM alpine:3.8
2
3LABEL maintainer="SDN-C Team (sdnc@lists.openecomp.org)"
4ARG PIP_TAG=18.0
5
6WORKDIR /opt/
7
8COPY ansible-server/requirements.txt ansible-server/requirements.txt
9
Taka Cho9bec8482019-02-18 14:31:27 -050010RUN apk add --no-cache curl \
Taka Choef127a52019-11-01 15:52:15 -040011 iputils \
Taka Cho9bec8482019-02-18 14:31:27 -050012 bash \
Sylvain Desbureaux78327d72019-03-05 17:40:10 +010013 openssh-client \
Taka Choef127a52019-11-01 15:52:15 -040014 python3 &&\
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +010015 apk add --no-cache --virtual .build-deps build-base \
16 libffi-dev \
17 openssl-dev \
Taka Choef127a52019-11-01 15:52:15 -040018 python3-dev &&\
19 pip3 install --no-cache-dir --upgrade pip==$PIP_TAG && \
20 pip3 install --no-cache-dir -r ansible-server/requirements.txt &&\
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +010021 apk del .build-deps
22
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050023RUN addgroup -S ansible && adduser -S ansible -G ansible
Taka Choef127a52019-11-01 15:52:15 -040024
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050025COPY --chown=ansible:ansible ansible-server ansible-server
26COPY --chown=ansible:ansible configuration/ansible.cfg /etc/ansible/ansible.cfg
27
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +010028WORKDIR /opt/ansible-server
29
Timoney, Dan (dt5972)15f406b2019-02-06 17:14:45 -050030RUN mkdir /opt/onap ; ln -s /opt/ansible-server /opt/onap/ccsdk
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050031RUN echo > /var/log/ansible-server.log
Taka Choc6e85bc2019-04-22 11:54:32 -040032RUN chown -R ansible:ansible /var/log
Sylvain Desbureaux78327d72019-03-05 17:40:10 +010033RUN chown ansible:ansible /opt/ansible-server
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050034
35USER ansible:ansible
36
Timoney, Dan (dt5972)15f406b2019-02-06 17:14:45 -050037
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +010038EXPOSE 8000
39
Taka Cho9bec8482019-02-18 14:31:27 -050040##ENTRYPOINT ["python2", "RestServer.py"]