-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildx new builder do not use proxy settings of default docker daemon. #136
Comments
Only builders backed by docker driver use the docker daemon config. For the container driver you need to either use |
@tonistiigi I'm behind proxy. And I set DNS settings on /etc/docker/daemon.json As a result, I'm able to use normally docker behind proxy. Here is my try.
Would you have any idea for this problem? |
Container driver does not use the settings from docker daemon config. There isn't currently a way to set proxy settings in buildkit config but it could be added. Or we could just add it to An ugly workaround currently is to create a new buildkit image based on edit: for clarity. The config currently allows setting mirrors to registries but doesn't allow setting up global |
You can use |
@sirlatrom when I use to set proxy, I get |
@spejic88: I recommend you open a new issue with a reproducible example, and make sure to specify what component versions are in use. |
Sir @tonistiigi , I try to use registry mirror in But it seem do not work. it's slowly as usual. configs and commands as belowconfig.toml# registry configures a new Docker register used for cache import or output.
[registry.aliyun]
mirrors = ["wlzfs4t4.mirror.aliyuncs.com"]
# http = true
# insecure = true
# ca=["/etc/config/myca.pem"]
# [[registry."docker.io".keypair]]
# key="/etc/config/key.pem"
# cert="/etc/config/cert.pem" Makefilebuild:
docker buildx build --platform=linux/amd64 --load --tag tangx/debian:10 .
build-cache-from:
docker buildx build --platform=linux/amd64 --tag tangx/debian:10 --cache-from=wlzfs4t4.mirror.aliyuncs.com/library/debian:10 .
qcloud-builder:
docker buildx create --use --name qcloud-mirrors --config=config.toml
$(MAKE) ls
ls:
docker buildx ls
DockerfileFROM debian:10
command# make qcloud-builder
docker buildx create --use --name qcloud-mirrors --config=config.toml
qcloud-mirrors
make ls
make[1]: Entering directory '/data/alpine'
docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS PLATFORMS
qcloud-mirrors * docker-container
qcloud-mirrors0 unix:///var/run/docker.sock inactive
default docker
default default running linux/amd64, linux/386
make[1]: Leaving directory '/data/alpine'
######
# make build
docker buildx build --platform=linux/amd64 --load --tag tangx/debian:10 .
[+] Building 96.4s (3/4)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 31B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/debian:10 6.6s
=> [1/1] FROM docker.io/library/debian:10@sha256:68f4e2259032a4e6f5035804e64438b52af8dd5889528b305b9059183ea4cd2a 89.8s
=> => resolve docker.io/library/debian:10@sha256:68f4e2259032a4e6f5035804e64438b52af8dd5889528b305b9059183ea4cd2a 0.0s
=> => sha256:68f4e2259032a4e6f5035804e64438b52af8dd5889528b305b9059183ea4cd2a 1.85kB / 1.85kB 0.0s
=> => sha256:aaaaf56b44807c64d294e6c8059b479f35350b454492398225034174808d1726 529B / 529B 0.0s
=> => sha256:31dd5ebca5efc5e96a425402fa85e492b02c8fe757dfd3edfdea2a7c67322909 2.81MB / 50.39MB 75.9s
=> => sha256:ae8514941ea4f23d4948150debf0f92a427c136aa4e7fb85f9c56bba09452572 1.50kB / 1.50kB 0.0s
|
@tangx Not sure what registry you're trying to mirror. I see |
@tonistiigi , thank you. I got it .
buildkitd.toml# registry configures a new Docker register used for cache import or output.
[registry."docker.io"]
mirrors = ["wlzfs4t4.mirror.aliyuncs.com"]
# http = true
# insecure = true
# ca=["/etc/config/myca.pem"]
# [[registry."docker.io".keypair]]
# key="/etc/config/key.pem"
# cert="/etc/config/cert.pem" command result# make
docker buildx build --platform=linux/amd64 --load --tag tangx/debian:10 .
[+] Building 22.6s (6/6) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 51B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/debian:9 16.6s
=> [1/1] FROM docker.io/library/debian:9@sha256:e984d8384d582e61f128920ec63c18a46bb23bc67d7c29a8311a44a69077edab 4.5s
=> => resolve docker.io/library/debian:9@sha256:e984d8384d582e61f128920ec63c18a46bb23bc67d7c29a8311a44a69077edab 0.0s
=> => sha256:9db90d8ea0e09374bbd206cde64e3539f1e761be051cc6d1710070de95e914c3 529B / 529B 0.0s
=> => sha256:7e6d8ed603557d9bf077a9ace4ee506501970a4938b9a704f040ad15f22bd4e8 45.37MB / 45.37MB 2.3s
=> => sha256:5df937d2ac6c936d827fdb923241c10c7f7e44e89e468c2c7952fc3369fcc873 1.50kB / 1.50kB 0.0s
=> => sha256:e984d8384d582e61f128920ec63c18a46bb23bc67d7c29a8311a44a69077edab 1.21kB / 1.21kB 0.0s
=> => unpacking docker.io/library/debian:9@sha256:e984d8384d582e61f128920ec63c18a46bb23bc67d7c29a8311a44a69077edab 1.9s
=> exporting to oci image format 1.5s
=> => exporting layers 0.0s
=> => exporting manifest sha256:b34997be350208e597f6c6b6e8bd4d62c1d193e61016ca15fd242d31baa52992 0.0s
=> => exporting config sha256:4fe8baa05f597001e236089c59633a1688acbc98f6249aac499a0598107259b1 0.0s
=> => sending tarball 1.4s
=> importing to docker 0.0s |
@tangx I have met this problem too. I have catched the network traffic but find no package to mirror. |
I'm having the same issue. I'm using the buildx action with: - name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
buildkitd-flags: --config /etc/buildkit/buildkitd.toml $ cat /etc/buildkit/buildkitd.toml
[registry."docker.io"]
mirrors = ["nexus.internal.domain"] $ cat /etc/docker/daemon.json
{
[...]
"registry-mirrors": ["https://nexus.internal.domain"],
[...]
} I can see that the buildx image is pulled from my private registry, but when buildx is trying to pull images it ignores the registry. Example: error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to copy: httpReadSeeker: failed open: unexpected status code https://registry-1.docker.io/v2/library/alpine/manifests/sha256:69e70a79f2d41ab5d637de98c1e0b055206ba40a8145e7bddb55ccc04e13cf8f: 429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit I have no idea how to fix this without removing buildx from the build steps. Looks like buildx is ignoring the config, but if I set a wrong key it will complain about it. #################### edit #################### Looks like my issue is caused by |
@crazy-max in last comment, does closing because resolved and last comments offtopic |
@tonistiigi, how would we go about what you mention in this comment?
I saw @sirlatrom's #170, but that only applies to the But even if similar support is added to the Finally, I'm not sure about all possible implications of having the proxy settings in the Thoughts? Related:
|
Bug: while trying to build multiarchitecture image using
buildx
, proxy settings of docker daemon are ignored, resulting unable to download the images.This is only reproducible in Linux, Docker desktop for Mac works fine.
Steps to be followed
ref: same steps from : docker-for-arm-on-linux
error:
Software versions:
The text was updated successfully, but these errors were encountered: