Kubernetes can't pull images built on MacOS but can for Windows

I’m having the weirdest issue. I have a private hub repo and a kubernetes cluster. The cluster is set up to pull images from my repo. For whatever reason when I build and push to my repo from Windows, I have no problem pulling the images. However when I build and push from MacOS my kubernetes cluster can not pull the image and tells me it’s not found.

When I visit my repo on Hub and go to the tags section I just get an error screen. When I try to go to the support site to open a ticket I also get an error screen.

Any ideas on what could cause this? Running latest windows and macos with latest versions of the Docker Desktop installed and everything should be up to date.

Maybe it’s related to the CPU architecture used. Windows and Linux server are usually Intel/AMD, newer Macs use ARM. Do you build and push multi-arch images?

I’m not aware of any such issue. I’m deploying a typescript nodejs project, here’s my docker file:

FROM node:22-alpine
WORKDIR /
COPY package.json ./
RUN npm install --production
COPY . .
EXPOSE 3000
CMD [“npm”, “start”]

This is pretty basic. In the docker hub interface, which I got working luckily, it says ‘linux/amd64’ for both the windows and macos build.

I would assume since they are both built into an alpine linux image they should functionally be the exact same.

But the error kubernetes give me is that the macos image is not found, not that there is a problem running it. I see the properly tagged image in my dockerhub so I know it exists and there shouldn’t be a reason why it can pull the image.

If the arhchitecture was wrong, the image could not be pulled. It wouldn’t just fail when trying to run a container from it.

Can you push and share one image built on macOS and one built on Windows for us to try to find the difference?

Also can you share the exact error message you can in Kubernetes? You can replace the name with a placeholder if you wouldn’t share that, but if the issue is not the architecture, I can only think of a wrong name, so you should double check that.

Sorry for the late reply, I was busy building a new app and didn’t have a reason to try and pull a new image. But was doing a new deployment today and sure enough you are exactly right - it is an image issue.

By default MacOS will build a linux/arm64 and I needed a linux/amd64 image.

Adding --platform=linux/amd64 to my docker build command fixed the issue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.