Docker pull from my docker hub account does not work on mac

I am having a problem pulling a docker image from my own docker hub account when using my mac mini m4 (latest OS).

First: I can pull any public image from dockerhub, like nginx or ‘hello-world’ and so on. The mac works fine with these public images. It just won’t pull an image from my personal dockerhub repo. (and yes, it’s public!)

Background:
I build the app following tutorials on a windows 11 machine and successfully pushed it to my personal docker hub account.

On the windows 11 machine I can successfully pull and run this image without any problems.
(basically after it can’t find the image locally it goes to dockerhub and pulls the image from my personal repo). I am logged in to dockerhub on the win11 machine, and also to dockerhub with my account. I can see/pull/run the image on win11.

docker run /test-image (docker pull also works)

When I do the same thing on my mac, it stops after “can’t find image locally” and issues an error. I am using docker desktop on the mac, I am logged in using my correct account. I can log in to dockerhub and go to my area and see the image. But when I try and get the image it won’t proceed after “no local image”.

How do I get docker to “keep going” with my personal images on dockerhub on the mac?

(or… what exactly is going wrong). Thanks.

I assume you build Linux images, not Windows images and your Windows has amd64 architecture and your Mac could have arm64. Then you can only use the image if you emulate amd64 on your Mac by specifying --platform linux/amd64.

Am I right about the architecture?

Update. I decided I needed to verify the same setup that was working on my win11 machine would work on the mac, and IT WORKS.

I was able to build and push the image to dockerhub, both from within docker desktop and from a terminal window.

HOWEVER, on further playing I discovered the win11 image WON’T pull on the mac, but the mac version I just built will pull. Then error trying to pull the win 11 image is:
Error response from daemon: no matching manifest for linux/arm64/v8 in the manifest list entries: no match in manifest for platform: not found

So I thought this stuff was supposed to be universal? What did I miss?
Summary: same exact Dockerfile in same named directory on both win11 and mac m4, same exact build command used (different image name for win11 & mac). Both win 11 and mac m4 can push or pull their images without issue. BUT - the mac can’t pull the image created on win11.

… AND last update. The win11 system CANNOT pull the image created on the mac m4 and pushed to my dockerhub.

SO… I’m missing something about the “universal” … time to do some more reading!!!

This may be of interest for some, but otherwise you can now kinda skip this thread unless someone knows a quick link to the appropriate document for “universal image for any OS”

You are correct. I didn’t see your post before I posted my own replies (to my own question) below. I discovered exactly what you described - images appear to be built for specific architectures.

I need to go do some reading now on the --platform option (and all build options really)

Thanks!
-R

I recommend reading this as well

It shows how you can build imags for multiple architcture. This way you emulate the architecture while building the image, which is more likely to work, but still not guaranteed. Then your docker client on Mac will pull the arm64 version automatically, while on Windows, the client will pull the amd64 version.

I’m reading it right now! :slight_smile:
-R

… and it works. I tried the simple example, pushing it to my dockerhub account. I then pulled it from dockerhub on both machines and ran it. It’s the simple image that tells which architecture it found.

on win11 it returns: X86_64
on mac mini 4 it returns: aarch64

So I have solved all the reported problems of this topic thread. THANKS rimelek!
-R