您的位置:首页 > 运维架构 > Docker

Docker中使用pip2遇到proxy问题的解决(Can't install pip packages inside a docker container)

2015-12-09 07:02 816 查看


遇到问题如下:

Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/python-dotenv/




解决方案亲测成功:


Adding Google DNS to your local config

Modifying /etc/resolv.conf and adding the following lines at the end

#
Google IPv4 nameservers


nameserver
8.8.8.8


nameserver
8.8.4.4


If you want to add other DNS servers, have a look here.

However this change won't be permanent (see this
thread). To make it permanent :
$
sudo nano /etc/dhcp/dhclient.conf
Uncomment and edit the line with prepend domain-name-server :
prepend
domain-name-servers 8.8.8.8, 8.8.4.4;


Restart dhclient :
$
sudo dhclient
.

解决方案引用至:http://stackoverflow.com/questions/28668180/cant-install-pip-packages-inside-a-docker-container-with-ubuntu
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: