docker / docker/buildx

buildx is does not respect the no_proxy variable

Open
#895 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

I am using buildx to build multi-arch containers. After setting up a builder and configuring the system environment variables to use a proxy as well as handing over the proxy and no_proxy variables to the builder instance the 'buildx build' command does not respect the no_proxy or NO_PROXY environment variable when using the --push parameter.

docker buildx create --use --name arm64-builder --driver=docker-container --driver-opt env.http_proxy=$http_proxy --driver-opt env.https_proxy=$https_proxy --driver-opt env.no_proxy=$no_proxy

docker buildx build --builder arm64-builder --platform linux/amd64,linux/arm64/v8  --tag "$CONTAINER_IMAGE"  --push . ;

As i am behind a corporate proxy I need to set the proxy variables to be able to access repositories on the internet, but the private image repository is only available within the corporate network. Therefore I need to set the no_proxy/NO_PROXY variables.
But it seems that the build --push command does not make use of the no_proxy and tries to reach the private container repo via public internet, which fails.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the docker buildx create and docker buildx build --push commands with proxy and no_proxy variables, then trace how proxy settings reach the push path. Done means private registries in no_proxy bypass the proxy while external repositories continue using it, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.