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

前端 未结 16 2320
抹茶落季
抹茶落季 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:37

    In my case, with docker version 1.13.0 and docker-machine 0.9.0 under Ubuntu 16.04 I had to modify slightly Tanzaho's answer (2. Modifying Docker config) as follows:

    1. Log into Ubuntu as a user with sudo privileges.

    2. Open the /etc/default/docker file for editing:

      sudo vim /etc/default/docker
      
    3. Add the following setting for Docker.

      DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
      
    4. Save and close the file.

    5. Restart the Docker daemon :

      sudo service docker restart
      

提交回复
热议问题