Can't install pip packages inside a docker container with Ubuntu

前端 未结 16 2342
抹茶落季
抹茶落季 2020-11-30 19:07

I\'m following the fig guide to using docker with a python application, but when docker gets up to the command

RUN pip install -r requirements.txt

16条回答
  •  一向
    一向 (楼主)
    2020-11-30 19:30

    Let it run. Sometimes pypi is having connection issues which are noisily put in your face to make you think it is broke. Just to be sure, let it roll, you might find it works it out for itself.

    The bottom line, despite these red error lines, is "Successfully built"

    $ docker build .
    Sending build context to Docker daemon 2.048 kB
    Step 1 : FROM docker-registry.aws.example.com:5000/cmcrc/python2:20160517120608
     ---> 1e5034711aa9
    Step 2 : RUN pip install prometheus-client requests
     ---> Running in f3c580fc93ae
    Collecting prometheus-client
      Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/prometheus-client/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/prometheus-client/
      Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/prometheus-client/
      Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/prometheus-client/
      Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/prometheus-client/
      Downloading prometheus_client-0.0.13.tar.gz
    Collecting requests
      Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/requests/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/requests/
      Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/requests/
      Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/requests/
      Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/requests/
      Downloading requests-2.10.0-py2.py3-none-any.whl (506kB)
    Building wheels for collected packages: prometheus-client
      Running setup.py bdist_wheel for prometheus-client: started
      Running setup.py bdist_wheel for prometheus-client: finished with status 'done'
      Stored in directory: /root/.cache/pip/wheels/04/94/f5/b803b2ff65e8344e99ca99b7f7cb8194224017167809a32b78
    Successfully built prometheus-client
    Installing collected packages: prometheus-client, requests
    Successfully installed prometheus-client-0.0.13 requests-2.10.0
     ---> 19c5e3cfe08f
    Removing intermediate container f3c580fc93ae
    Successfully built 19c5e3cfe08f
    

提交回复
热议问题