fix odl patches
[ccsdk/distribution.git] / ansible-server / src / main / Dockerfile
1 FROM onap/integration-python:8.0.0
2 LABEL maintainer="SDN-C Team (sdnc@lists.openecomp.org)"
3 USER root
4
5 ARG http_proxy
6 ARG https_proxy
7 ARG no_proxy
8 ARG CURL_CA_BUNDLE
9
10 ENV http_proxy $http_proxy
11 ENV https_proxy $https_proxy
12 ENV no_proxy $no_proxy
13 ENV PIP_EXTRA_OPTS ${https_proxy:+"--trusted-host pypi.org --trusted-host files.pythonhosted.org --proxy=${https_proxy}"}
14 ENV PIP_EXTRA_OPTS ${PIP_EXTRA_OPTS:-""}
15 ENV CURL_CA_BUNDLE=$CURL_CA_BUNDLE
16
17 ARG PIP_TAG=18.0
18
19 RUN addgroup -S ansible && adduser -S ansible -G ansible
20 COPY --chown=ansible:ansible ansible-server /opt/ansible-server
21 COPY --chown=ansible:ansible configuration/ansible.cfg /etc/ansible/ansible.cfg
22
23 # Copy any certs
24 COPY *.md *.pem /etc/ssl/certs/
25
26 # Install certs
27 RUN update-ca-certificates
28
29 RUN echo $CURL_CA_BUNDLE && ls -l $CURL_CA_BUNDLE
30
31 RUN apk add --no-cache curl iputils bash openssh-client \
32     && curl -k https://sh.rustup.rs -sSf | sh -s -- -y \
33     && source $HOME/.cargo/env \
34     && apk add --no-cache --virtual .build-deps build-base libffi-dev openssl-dev python3-dev \
35     && pip3 install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org --upgrade pip ${PIP_EXTRA_OPTS} \
36     && pip3 install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r /opt/ansible-server/requirements.txt ${PIP_EXTRA_OPTS} \
37     && apk del .build-deps \
38     && mkdir -p /opt/onap \
39     && touch /var/log/ansible-server.log \
40     && chown -R ansible:ansible /var/log
41
42 USER ansible:ansible
43 EXPOSE 8000
44 WORKDIR /opt/ansible-server
45 ##ENTRYPOINT ["python2", "RestServer.py"]