一共两个部分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 ...