配置hysteria客户端

搭建hysteria服务端参考 https://github.com/apernet/hysteria

下载hysteria二进制文件
https://github.com/apernet/hysteria/releases

创建config.yaml文件

# 服务端地址和端口
server: 64.112.**.**:8081
# 服务端密码
auth: passwd
# 带宽
bandwidth: 
  up: 100 mbps
  down: 100 mbps
# 代理端口
socks5:
  listen: 0.0.0.0:1080

http:
  listen: mek.030399.xyz
# 跳过证书校验
tls:
  insecure: true

创建hysteria.service文件

[Unit]
Description=hysteria
After=network.target

[Service]
Type=simple
ExecStart=/root/hysteria/hysteria-linux-amd64
WorkingDirectory=/root/hysteria
Restart=always

[Install]
WantedBy=multi-user.target

启动服务

cp hysteria.service /etc/systemd/system/hysteria.service
systemctl daemon-reload
systemctl start hysteria
systemctl enable hysteria

配置Docker代理

创建代理配置文件

mkdir -p /etc/systemd/system/docker.service.d
vim /etc/systemd/system/docker.service.d/proxy.conf
# /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://mek.030399.xyz/"
Environment="HTTPS_PROXY=http://mek.030399.xyz/"
Environment="NO_PROXY=127.0.0.1,localhost,192.168.*,*.example.com"

重启Docker

systemctl daemon-reload
systemctl restart docker

检查确认环境变量已经正确配置

sudo systemctl show --property=Environment docker

可以拉取镜像试试了