环境是在centos下,如果没有新建下面这个文件夹
1
| sudo mkdir -p /etc/systemd/system/docker.service.d
|
之后新建下面这个文件走http代理
1
| sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf
|
填入
1
2
| [Service]
Environment="HTTP_PROXY=http://192.168.88.10:7890/"
|
编辑下面这个文件走https代理
1
| vim /etc/systemd/system/docker.service.d/https-proxy.conf
|
修改为
1
2
| [Service]
Environment="HTTPS_PROXY=https://proxy.example.com:443/"
|
之后你使用docker pull的时候就可以pull gcr.io上的镜像了
https://juejin.im/post/5cc7b53c51882525124126f1
https://docs.docker.com/config/daemon/systemd
创建或修改 /etc/docker/daemon.json
1
2
3
4
5
6
7
8
9
10
11
12
13
| sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://u8rbddql.mirror.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn",
"https://mirror.ccs.tencentyun.com",
"https://registry.docker-cn.com"
]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
|
https://juejin.im/post/5cd2cf01f265da0374189441