-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Wrong platform architecture on Docker Hub Images #735
Comments
Does the issue still show with using the plain |
Yes, I just tried the |
Hmm, on a Raspberry Pi I just tried:
Edit:
|
Ok that is really weird, I ran the same command as you did and still got the error/warning:
Edit: I also tried removing all pihole containers and images from my raspberry and let it re-pull during the run command, but still the same warning. |
What does your
And try Also, what does
Edit: And for comparison:
|
And I think this came up before, but the way you install docker can cause problems. If this is Raspbian Buster then you can't https://docs.docker.com/engine/install/debian/#install-using-the-repository |
Ok was too late with my previous edit :D Other output:
Edit: Server version
|
Regarding the Docker installation on Raspbian: I am aware of the complications. |
Looks like we have different kernel versions and docker versions. What version of Raspberry Pi is the hardware, and what does
show? |
|
The Raspberry Pi is a "Raspberry Pi 3 Model B Plus Rev 1.3" |
I see a similar report that mirrors what we are seeing. Docker 20 fails, docker 19 works: |
Hmm yes this seems to be the issue. I just downgraded to |
Maybe another thing:
Even the v5.2.1-armhf-buster image says "Architecture": "amd64" I found moby/moby#36552 where the issue about wrong archs is being discussed for quite some time. Might it be that the arch is wrongly declared during the image build process somehow? |
If it is then its affecting multiple projects and thus I would consider that to be a problem with docker and not with the multiple projects that work fine in version 19. |
In re: that moby issue, it's rather clear that the |
I was trying to figure out the build process of the pihole containers but I am struggling with that. The other thing I found were scripts for Github Actions, which I assume are used now. Another thing: I tried building an arm container on an amd64 machine with docker buildx, following this guide. And this worked successfully.
And then
And then docker correctly! complains about the image, since I tried to run it on my amd64 machine:
So maybe the image build process needs an improvement or update. |
|
@lightswitch05 Do you have any advice? |
How the base images are built: https://github.com/pi-hole/docker-base-images/blob/master/tag-and-push.sh#L3-L6 Images are built and pushed with
|
When it comes down to it, it works in 19, doesn't in 20. That tells me that docker broke something in 20. And again, there are multiple projects that are seeing this same issue so we're not a one-off. If you want to improve the build process, then please do. But if it's a process that then works in 20 and doesn't work in 19 we're in the same boat. I'd wait to see what docker says as far as why 20 doesn't work. |
Thank you two for your input. |
Did some further digging, and I suspect these images are cross-compiled on a amd64 (x86) machine, and have the incorrect architecture set in the image manifest (docker/for-linux#1170 (comment)) docker/for-linux#1170 (comment)
Perhaps a "I know what I'm doing; ignore what the image says" flag would be needed to allow running existing invalid images? |
Slightly more detail under what circumstances it fails (due to the image being invalid / having incorrect os/architecture in the metadata); docker/for-linux#1170 (comment) |
I think the correct fix for this would be to use docker-pi-hole/gh-actions-test.sh Lines 18 to 28 in a779c7f
With docker/build-push-action@v2 it should be possible to build (and push) a multi-arch image in oneusing buildx (and no need to manually set up qemu); See the example here; https://github.com/docker/build-push-action#multi-platform-image;
but perhaps @crazy-max or @tonistiigi has additional hints |
Happy to investigate this. As long as it's a backwards compatible fix and won't bork the installs still on 19. |
It should be backward compatible; The existing images are technically invalid, and the reason it worked on docker 19.03 (and before) was that it happened to fully ignore the architecture in the image-metadata once the image was pulled. |
Thanks! Will review. |
Ah, right; in this case I'm not sure that would be the desired info, as this repository only contains the scripts to build the Dockerfile, not the source-code 🤔 (at least, I somewhat would expect the image to contain info about |
@thaJeztah Yes sure you can overwrite labels too. |
Ahem, yes that script has grown quite organically over the years - I like to think I know it like the back of my hand - but appreciate that others get lost in it, If you have any questions.... At some point, we're going to be looking at really paring down |
Thanks for the help everyone! Before things get too far, musl and Edit: I guess the issues with the musl builds are just for aarch64/arm. I see there's a stable x86 musl build but I'm not sure that helps with multiple platform arch's as the goal? https://github.com/pi-hole/FTL/releases/tag/v5.6 |
@DL6ER Any thoughts on musl? |
Sorry for the late reply. I'm back in operation now. FTL is designed to be able to be fully statically linked (including the crypto library, LUA and everything else). This is reflected by the architecture tests each CI build has to comply with to pass the tests for this commit. These are said tests for elif [[ "${CIRCLE_JOB}" == "x86_64-musl" ]]; then
check_machine "ELF64" "Advanced Micro Devices X86-64"
check_static # Binary should not rely on any dynamic interpreter
check_libs "" # No dependency on any shared library is intended
check_file "ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped" If there would be a single dynamic dependency, this test would fail and the binary would be rejected. The reason for a missing pre-compiled So I'm not exactly sure what the question is here, @crazy-max do you see any issues |
sudo docker run -it --platform=linux/arm64 /bin/bash |
This issue has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/platform-mismatch-with-docker-on-rpi4/47523/1 |
If anyone at all can help with this, please help! |
This is causing issues with Podman 3.2 as reported here: containers/podman#10682 |
Hullo all, sorry for taking such a long time to get around to this... it should now be fixed in the latest |
Hi @PromoFaux, this looks really good now.
Thank you for your work! 😀 |
Good news, then my entire day yesterday was not wasted! (So even better news 😜) Will hopefully will through with the next main tag/release currently in the process of checking which arch's build ( on branch |
I tried the new image |
There are probably more improvements that can come in time with this, but just want to say thanks to @crazy-max and @thaJeztah for their hints and pointers above. |
Thanks! Happy to see it works well for you. If you have feedback to either the buildx cli, buildkit (which does the actual build), or the github actions; feel free to open tickets there (I linked the repositories) 🤗 |
Platform
Expected behavior
The right platform architecture is assigned to the respective images.
Actual behavior / bug
The arch specific images are tagged with the wrong platform architecture.
Currently they all show amd64 as architecture regardless if they are specific arm or arm64 images.
Check for example the v5.2.1-armhf-buster
This armhf images wrongly displays amd64 as its architecture.
When using the image in my deployment it still works in the end, but Ansible complains with a warning that the image has the wrong architecture:
I also tried the multi-arch image (e.g. v5.2.1-buster) which shows at least all three architectures (amd64/arm/arm64) in Docker Hub, but this also gives the same warning. So even there, the arch detection is somewhat broken.
Can you please have a look into this. Thanks.
The text was updated successfully, but these errors were encountered: