How to start pip3 + git due to proxy from docker?

How to install git proxy on startup using pip3?

Following the instructions https://github.com/nouiz/Theano-Docker

When I run docker build -t theano_simple -f Dockerfile.0.8.X.jupyter.cuda.simple . I get an error:

 fatal: unable to connect to github.com: github.com[0: 192.30.253.112]: errno=Connection timed out github.com[1: 192.30.253.113]: errno=Connection timed out 

Adding proxy server settings to the docker file:

 RUN git config --global http.proxy myproxy:1111 RUN git config --global https.proxy myproxy:1111 

ENV HTTPS_PROXY = https: // myproxy: 1111 ENV HTTPS_PROXY = https: // myproxy: 1111 ENV https_proxy = https: // myproxy: 1111 ENV https_proxy = https: // myproxy: 1111

Here is the original docker file: https://github.com/nouiz/Theano-Docker/blob/master/Dockerfile.0.8.X.jupyter.cuda.simple

  FROM nvidia/cuda:7.5-cudnn5-devel MAINTAINER FIX ME < fixme@example.com > RUN apt-get update && apt-get install -y --no-install-recommends \ git \ libopenblas-dev \ libzmq3-dev \ python3-dev \ python3-numpy \ python3-pip \ python3-scipy && \ rm -rf /var/lib/apt/lists/* RUN pip3 install \ ipykernel \ jupyter && \ python3 -m ipykernel.kernelspec RUN pip3 install nose nose-parameterized ENV THEANO_VERSION 0.8.2 RUN pip3 install git+git://github.com/theano/ theano.git@rel- ${THEANO_VERSION} COPY theanorc /root/.theanorc COPY start-notebook.sh /usr/local/bin/ COPY jupyter_notebook_config_simple.py /root/.jupyter/jupyter_notebook_config.py COPY notebook /opt/notebook RUN apt-get update && apt-get install -y curl RUN mkdir /opt/data && cd /opt/data && curl http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist_py3k.pkl.gz -o mnist.pkl.gz 

Modified docker file with proxy commands:

  FROM nvidia/cuda:7.5-cudnn5-devel MAINTAINER FIX ME < fixme@example.com > RUN apt-get update && apt-get install -y --no-install-recommends \ git \ libopenblas-dev \ libzmq3-dev \ python3-dev \ python3-numpy \ python3-pip \ python3-scipy && \ rm -rf /var/lib/apt/lists/* RUN pip3 install \ ipykernel \ jupyter && \ python3 -m ipykernel.kernelspec RUN pip3 install nose nose-parameterized ENV THEANO_VERSION 0.8.2 ENV HTTPS_PROXY=https://myproxy:1111 ENV HTTPS_PROXY=https://myproxy:1111 ENV https_proxy=https://myproxy:1111 ENV https_proxy=https://myproxy:1111 RUN pip3 install git+git://github.com/theano/ theano.git@rel- ${THEANO_VERSION} RUN git config --global http.proxy myproxy:1111 RUN git config --global https.proxy myproxy:1111 COPY theanorc /root/.theanorc COPY start-notebook.sh /usr/local/bin/ COPY jupyter_notebook_config_simple.py /root/.jupyter/jupyter_notebook_config.py COPY notebook /opt/notebook RUN apt-get update && apt-get install -y curl RUN mkdir /opt/data && cd /opt/data && curl http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist_py3k.pkl.gz -o mnist.pkl.gz 

I also tried passing the proxy server as part of the pip3 install : pip3 install --proxy myproxy:1111 , but the same error.

0
source share
2 answers
 fatal: unable to connect to github.com: github.com[0: 192.30.253.112]: errno=Connection timed out github.com[1: 192.30.253.113]: errno=Connection timed out 

The error message seems to be the reason for the RUN pip3 install , so adding a proxy for git does not work for this.

You can try adding HTTPS_PROXY env to pip install .

 ENV HTTPS_PROXY=https://myproxy:1111 

Using pip behind a proxy server

+1
source

Have you tried the following?

 pip3 install yourmodulename --trusted-host pypi.python.org 
0
source

Source: https://habr.com/ru/post/1261642/


All Articles