搭建docker镜像代理

2021-02-20  本文已影响0人  生活就是闹剧

问题描述

解决思路


Demo

# 已有镜像加速查看
# docker info
.....
 Registry Mirrors:
  http://hub-mirror.c.163.com/
  https://dhq94f.mirror.aliyuncs.com/
  https://docker.mirrors.ustc.edu.cn/
  https://registry.docker-cn.com/
.....

# docker pull calico/cni:v3.17.3
"http: TLS handshake timeout"

# 搭建v2raya
# docker run -d \
--restart=always \
--privileged \
--network=host \
--name v2raya \
-v /etc/v2raya:/etc/v2raya \
mzz2017/v2raya
需要Ghelper的订阅base64解码
# https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
# mkdir -p /etc/systemd/system/docker.service.d
# vi /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://localhost:20171"
Environment="HTTPS_PROXY=http://localhost:20171"
Environment="NO_PROXY=localhost,127.0.0.1"

# systemctl daemon-reload
# systemctl restart docker

# 测试通道
# curl -s -x localhost:20171 http://ip.tool.chinaz.com | grep -C 1 "您的"
            <dl class="IpMRig-tit">
                <dt>您的IP</dt>
                <dd class="fz24">218.255.149.34</dd>

# 测试拉取
# docker pull calico/cni:v3.17.3
v3.17.3: Pulling from calico/cni
f9b053be2b0b: Pull complete 
d170aa98f431: Pull complete 
63130043cefa: Pull complete 
Digest: sha256:ee8094aabb4406299fe7a41c5dec8cada52d49b93bac24d83d0b9c4aeb3c6085
Status: Downloaded newer image for calico/cni:v3.17.3
docker.io/calico/cni:v3.17.3

上一篇下一篇

猜你喜欢

热点阅读