Docker设置代理

拉取失败的信息如下:

Pulling gitlab (gitlab/gitlab-ce:12.1.3-ce.0)...
ERROR: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

通过下面设置就能正常拉取:

## 先停止Docker
systemctl stop docker

## 修改Docker配置文件
vim /lib/systemd/system/docker.service
## 在 [Service] 节点下面新增代理信息
[Service]
......
Environment="HTTP_PROXY=http://10.72.1.253:8080/" "HTTPS_PROXY=http://10.72.1.253:8080/"

## 查询加载Docker并启动 hecg
systemctl daemon-reload
systemctl restart docker