-
Notifications
You must be signed in to change notification settings - Fork 121
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 pull --platform=linux/arm64 silently falls back to linux/amd64 image #5625
Comments
Thanks for reporting! The For non-multi-arch images, we had to be slightly more "permissive" for backward compatibility, and it is (currently) ignored, although we probably could make this an "error" if I agree that this scenario at least should print a warning, and I'm pushing a pull request in the upstream "moby" repository for this (possibly to be included in a patch release), and will open a tracking issue to consider making this specific scenario an error instead of a warning (but pulling a single-arch, non-matching image without specifying Some issues / pull requests related to the above: |
Pull request; moby/moby#42325 |
thanks for chasing this up, @thaJeztah! I don't have the wider view of compatibility hazards that Docker developers clearly do, but in my narrow little world I think it should be an error |
I confirm the issue on Raspberry Pi 4b, Ubuntu 20.04 aarch64 (arm64). docker pull --platform=linux/arm64 guacamole/guacamole docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > initdb.sql This is not user-friendly. |
Now having this issue trying to build a docker of charge-lnd on a Raspberry Pi 4B as well: Has anyone figured out a way around this? It's driving me crazy. |
I don't know if anybody is still watching this issue, but it's still open. So I'll add something else to the mix. If you have locally cached images, it will consider them a match, instead of checking for a multi-arch build:
So, this appeared on one of my build servers. As part of initialization of that build server, we pre-cache some upstream images by running docker pull {image}. When actually running builds on this machine, we use docker-compose with So I'm pretty sure the precaching is precaching the local platform. And then it gets later confused when a request comes in for a specific platform. |
is it possible to pull all the multi-arch images so they can be tagged and pushed to another registry? |
What version of docker are you running there, and are you using buildkit for builds? Does the same happen with a plain Tried reproducing that situation; Pull the docker pull --platform=linux/arm64 hello-world
Using default tag: latest
latest: Pulling from library/hello-world
Digest: sha256:cc15c5b292d8525effc0f89cb299f1804f3a725c8d05e158653a563f15e4f685
Status: Image is up to date for hello-world:latest
docker.io/library/hello-world:latest Building an image that uses that as a base-image, but specifying the target platform to build ( docker build --platform=linux/amd64 -t foo -<<EOF
FROM hello-world:latest
LABEL foo=bar
EOF
[+] Building 2.6s (6/6) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 80B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/hello-world:latest 2.2s
=> [auth] library/hello-world:pull token for registry-1.docker.io 0.0s
=> [1/1] FROM docker.io/library/hello-world:latest@sha256:cc15c5b292d8525effc0f89cb299f1804f3a725c8d05e158653a563f15e4f685 0.2s
=> => resolve docker.io/library/hello-world:latest@sha256:cc15c5b292d8525effc0f89cb299f1804f3a725c8d05e158653a563f15e4f685 0.0s
=> => sha256:2db29710123e3e53a794f2694094b9b4338aa9ee5c40b930cb8063a1be392c54 2.48kB / 2.48kB 0.2s
=> => sha256:cc15c5b292d8525effc0f89cb299f1804f3a725c8d05e158653a563f15e4f685 2.56kB / 2.56kB 0.0s
=> => sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4 525B / 525B 0.0s
=> => sha256:feb5d9fea6a5e9606aa995e879d862b825965ba48de054caab5ef356dc6b3412 1.47kB / 1.47kB 0.0s
=> => extracting sha256:2db29710123e3e53a794f2694094b9b4338aa9ee5c40b930cb8063a1be392c54 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:463ca4dc1fb39ebf35a4368b52fc5e2b72516379dd06e312022fa3f8bf46217f 0.0s
=> => naming to docker.io/library/foo 0.0s
docker inspect --format='{{.Architecture}}' foo
amd64 Even if no platform was specified, it looks like it's checking with the registry and pulling / using the correct variant; docker pull --platform=linux/arm64 hello-world
docker build -t foo -<<EOF
FROM hello-world:latest
LABEL foo=bar
EOF
[+] Building 1.0s (5/5) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 80B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/hello-world:latest 0.9s
=> CACHED [1/1] FROM docker.io/library/hello-world:latest@sha256:cc15c5b292d8525effc0f89cb299f1804f3a725c8d05e158653a563f15e4f685 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:463ca4dc1fb39ebf35a4368b52fc5e2b72516379dd06e312022fa3f8bf46217f 0.0s
=> => naming to docker.io/library/foo 0.0s
docker inspect --format='{{.Architecture}}' foo-amd64
amd64 |
Currently not; the local image cache can only store a single architecture per image, so if you pull the same image but with a different platform specified, then the latter will overwrite the former. Or, more factually, the image-layers will still be there (until you There are various tools that can help if you want to copy images (including all os/architectures) between registries (e.g. to mirror content), for example https://github.com/regclient/regclient |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
docker pull --platform=linux/arm64 ...
pulls image forlinux/arm64
platform, or fails with an error if it is not availableActual behavior
Docker appears to fall back to
linux/amd64
which was extremely surprising behaviourInformation
Also reproduced with 3.3.0 and 3.3.1 on an M1 Mac Mini
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: