-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
docker build --pull
does not respect insecure registries configuration
#3186
Comments
did u solve your problem? i have the same problem and don't know how to fix it... |
Its bug on docker side, you can not solve it directly. The only solution is to use secured registries with https, certificates etc. |
|
It's an issue with BuildKit, but may depend on the driver that's used for the builder (container driver, docker driver, etc.). I think various fixes have been implemented in BuildKit, but @crazy-max or @tonistiigi may have a better view on possibly remaining situations where the daemon configuration is not used for the builder. |
It's an annoying manner. Break my gitlab-runner for a long time. A quick fix: |
@liyuntao It's more of a workaround and you cannot use any modern Docker build features if you disable BuildKit. |
There's no way out of this for me. At least in the company. The inner image repository is not in my control. Personally, I would like to bump version or using modern features all the time. |
@liyuntao what version of docker are you using? I'm curious if this is still an issue with current versions of the docker engine (which contain updated versions of BuildKit). Note that docker no longer ships updated versions of 20.10 (we only package the current (24.0 at time of writing) version). Docker 20.10 is still packaged/maintained by Mirantis for their products, but will reach full EOL next month. |
Hi @thaJeztah thanks for your warm concern. We are using Ubuntu 22.04 as CI build server, and a self-hostd harbor served on 80 port.
When a base image does not exist locally:
So I had to export this env, and then everything went normal after a warning message.
|
Thanks! I think this ticket may be a duplicate of / duplicated by docker/buildx#1642 (comment) And I recall there was a fix for this that's merged and will be part of the upcoming v25.0 release of docker engine; /cc @jedevc could you check if that's indeed the same? |
@thaJeztah sorry for the delay - just caching up on a pile of emails now. This looks exactly like the symptoms around moby/moby#45992 - so would be fixed in the upcoming release. Even if it's somehow subtly different (potentially possible, the code around this is insanely fiddly), then it would still likely be affected by moby/moby#45992 in some way, since the logic has now been centralized. I think this is safe to close as a duplicate. |
Thanks! Let me go ahead and close this as duplicate. The patch above will be in the v25.0 release (beta's are available, and we're planning to do an rc + final release soon) |
Description
It seems like the
docker build --pull
flag does not respect insecure registries configuration as thedocker pull
does.Standard
docker pull <url>
works fine. But building fromDockerfile
using
docker build -t my-image --pull .
will fail. It is usinghttps
instead ofhttp
:Steps to reproduce the issue:
docker build
command with--pull
flag on Dockerfile with base image located at insecure registryDescribe the results you received:
Error - docker tried the url with https
Describe the results you expected:
Docker should fetch the image using http
Additional information you deem important (e.g. issue happens only occasionally):
This always happens. But it must have been broken some time ago, at some point this worked (like 2 years ago).
Output of
docker version
:Output of
docker info
:Migrated from distribution/distribution#3454.
The text was updated successfully, but these errors were encountered: