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

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

    Configuring docker DNS to Google DNS (8.8.8.8) or 10.0.0.2 did not work in my company environment.

    Running: $ drill @8.8.8.8 www.amazon.com or @10.0.0.2 confirmed this.

    In order to find a DNS that would work I ran: $ drill www.amazon.com and it gave me the DNS IP that is being used in my network.

    Then I set it in Ubuntu using the following step to configure docker's DNS.

    Changed dns in /etc/docker/daemon.json

    {
        "dns": ["the DNS ip from step1"]
    }
    
    Restart docker: sudo service docker restart
    

提交回复
热议问题