配置docker的代理
目录一.将socks5的代理转换成http的代理二.配置docker使用http的代理三.拉取镜像 关闭镜像加速器一.将socks5的代理转换成http的代理1.安装 epel-release仓库和privoxy并编辑配置文件yum -y install epel-releaseyum -y install privoxyvim /etc/privoxy/config2.内容如下listen-ad
·
目录
一.将socks5的代理转换成http的代理
1.安装 epel-release仓库和privoxy并编辑配置文件
yum -y install epel-release
yum -y install privoxy
vim /etc/privoxy/config
2.内容如下
listen-address 0.0.0.0:8118
forward-socks5t / 192.168.199.11:10808
192.168.199.11是可以访问谷歌的docker仓库的代理服务器
3.加入开机自启动并查看端口
systemctl enable privoxy --now
netstat -tunlp | grep 8118
二.配置docker使用http的代理
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo touch /etc/systemd/system/docker.service.d/proxy.conf
sudo chmod 777 /etc/systemd/system/docker.service.d/proxy.conf
sudo echo '
[Service]
Environment="HTTP_PROXY=http://10.163.1.110:8118" Environment="HTTPS_PROXY=http://10.163.1.110:8118"
' >> /etc/systemd/system/docker.service.d/proxy.conf
sudo systemctl daemon-reload
sudo systemctl restart docker
10.163.1.110是本机地址
三.拉取镜像 关闭镜像加速器
mv /etc/docker/daemon.json /etc/docker/daemon.json.bak
systemctl daemon-reload
systemctl restart docker
docker pull gcr.io/google-containers/ubuntu
docker pull gcr.io/google-containers/ubuntu:14.04
docker pull ubuntu:xenial-20210114
docker pull docker.io/library/ubuntu:latest
完成!!!
更多推荐
已为社区贡献3条内容
所有评论(0)