为 Docker BuildKit 使用代理

一共两个部分1

The BuildKit container — pulling images through the proxy

docker buildx create --use --name with_proxy \
  --driver-opt env.HTTP_PROXY=http://172.17.0.1:7890 \
  --driver-opt env.HTTPS_PROXY=http://172.17.0.1:7890

docker buildx inspect with_proxy --bootstrap

The docker buildx CLI — authorizing with docker.io, use the proxy

HTTPS_PROXY=http://172.17.0.1:7890 docker buildx --builder with_proxy build ...
  1. https://github.com/moby/buildkit/issues/4725#issuecomment-3172689316 ↩︎

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注