Docker代理
前提 需要一个梯子🪜 设置代理 用于拉取镜像 Configure the daemon to use a proxy 编辑 /etc/docker/daemon.json 文件,添加代理配置 { "proxies": { "http-proxy": "http://192.168.31.113:7897", "https-proxy": "http://192.168.31.113:7897", "no-proxy": "*.test.example.com,.example.org,127.0.0.0/8" } } 用于构建镜像 Proxy arguments 在 build 命令中使用 –build-arg 参数 docker image build -t web:latest --build-arg HTTP_PROXY=http://192.168.31.113:7897 --build-arg HTTPS_PROXY=http://192.168.31.113:7897 . 还可以试试直接添加环境变量 export https_proxy=http://192.168.31.86:7897 http_proxy=http://192.168.31.86:7897 all_proxy=socks5://192.168.31.86:7897 为容器设置代理 Automatic proxy configuration for containers ...