0

I'm trying to create a Docker image of python and to add a python library created by my company and hosted on gitlab (not public).

My Docker file is :

FROM continuumio/anaconda3

RUN apt-get update
RUN apt-get install -y curl

RUN pip install --upgrade pip

RUN pip install https://gitlab.criteois.com/ax-analytics/CriteoPy/repository/pep_8/archive.zip

WORKDIR home

CMD ["python3", "main.py"]

It looks like the step 5/7 is failing :

Step 5/7 : RUN pip install https://gitlab.criteois.com/ax-analytics/CriteoPy/repository/pep_8/archive.zip
 ---> Running in 8f04623ef493
Collecting https://gitlab.criteois.com/ax-analytics/CriteoPy/repository/pep_8/archive.zip
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8f926ae0f0>: Failed to establish a new connection: [Errno -5] No address associated with hostname',)': /ax-analytics/CriteoPy/repository/pep_8/archive.zip

The command '/bin/sh -c pip install https://gitlab.criteois.com/ax-analytics/CriteoPy/repository/pep_8/archive.zip' returned a non-zero code: 1

I'm suspecting some permission issue due to networking between docker on the host because when I run

cbslax@cbslax-desktop:~/Documents/DockerCriteoPy$ curl https://gitlab.criteois.com/ax-analytics/CriteoPy/repository/pep_8/archive.zip --output CriteoPy-Pep-8.zip

I'm able to download the library without any inputs

Nicolas N
  • 177
  • 1
  • 1
  • 8

1 Answers1

1

Try to add the --network host argument to your build command. It's not recommended but you will be able to see if there's an issue with the default bridge network that Docker creates by default.

Example

$ docker build <other args> --network host .

With the --network host argument, basically you are telling Docker to use your local network instead of the default bridge it created.

Fabian Rivera
  • 1,138
  • 7
  • 15
  • is there a way to setup the bridge within the Dockerfile ? – Nicolas N May 16 '18 at 21:15
  • actually, if you don't specify a --network value, the bridge network is created by default. Here is an awesome explanation about Docker networking: https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach?rq=1 – Fabian Rivera May 16 '18 at 23:14