使用代理获取镜像
由于国内网络受限,去到 Docker Hub 等获取镜像都会非常缓慢(甚至失败),如果有梯子,可以通过代理获取,此处使用 Clash 作为代理组件。
Docker 配置代理
在节点上准备 Clash 配置文件:
1 | # 将梯子的 .yaml 配置文件放在此处 |
启动 Clash 容器:
1 | docker run -d --restart=unless-stopped --name clash -v /root/clash/xxx.yaml:/root/.config/clash/config.yaml:ro -p 9090:9090 -p 7890:7890 -p 7891:7891 harbor.warnerchen.com/dreamacro/clash:v1.18.0 |
验证是否可用:
1 | curl -x http://localhost:7890 https://www.google.com -I |
创建 systemd 配置文件:
1 | cat <<EOF > /etc/systemd/system/docker.service.d/http-proxy.conf |
重启 Docker:
1 | systemctl daemon-reload |
验证是否可用:
1 | docker pull nginx:mainline |
You need to set
install_url
to use ShareThis. Please set it in _config.yml
.