Running arm64v8 docker container on x86 : apt update fails

I run docker from a WSL2 (under Windows 10 / no Docker Desktop not Rancher Desktop).
Here is my minimalist Dockerfile :

FROM arm64v8/ubuntu
CMD ["bash"]

I build it like that : sudo docker build -t test_4 .
Then I run it with : docker run -ti test_4
I am now in bash within the container :
#uname -a gives :
aarch64 aarch64 aarch64 GNU/Linux
So I hope I’m well on a aarch64 platform.
But then # apt update gives :

Ign:1 http://ports.ubuntu.com/ubuntu-ports noble InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease
Ign:1 http://ports.ubuntu.com/ubuntu-ports noble InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease
Ign:1 http://ports.ubuntu.com/ubuntu-ports noble InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease
Err:1 http://ports.ubuntu.com/ubuntu-ports noble InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:4 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/noble/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/noble-updates/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/noble-backports/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/noble-security/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

And of course, no apt install is possible…

By the way, if I try any other image from arm64v8 (such as busybox, gcc, python), I get the same error :

Unable to find image 'arm64v8/busybox:latest' locally
latest: Pulling from arm64v8/busybox
docker: no matching manifest for linux/amd64 in the manifest list entries.

Any idea ?
Thanx in advance !

Windows 10 usually runs on x86, do you have an Arm CPU?

Docker is not a VM, nor a CPU emulator, it usually only runs native images.

@bluepuma77 is right: you can’t just point to an image for a different cpu architecture and expect it will work out of th box.

Make sure to install the packages mentioned in QEMU without Docker Desktop, which then will allows docker to leverage qemu, which then emulates the target cpu architecture.

Once the pages are installed you can build and run images for other cpu architectures like this:

docker build --platform linux/arm64 -t test_4 .
docker run --platform linux/arm64 test_4

Thank you for your answer, but obviously I had install QEMU before.
Here is how I did it:

sudo apt install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

I think that my command uname -a wouldn’t work elsewhere…

I wrote make sure… well apparently you did. Mentioning it in the first post would have spared us this part of the conversation :smiley:

Still, this looks like the --platform argument was not specified while creating the container.