Multi-arch build using buildx gets stuck at pushing the image to Docker Hub

I am trying to build a multi-arch docker image using buildx. I use the following command.

docker buildx build --platform linux/amd64,linux/arm64 -t adityasamantlearnings/customers:v1 --push .

The build proceeds to the step of pushing the image to DockerHub’s remote repository.

At this stage my build hangs showing the logs below, probably due to an authentication issue.

 => => pushing layers                                                                                                                                      601.2s
 => [auth] adityasamantlearnings/customers:pull,push token for                                                                          0.0s

My repository exists. I am able to successfully push regular images using docker image push with no issues.

Just the push with docker buildx fails.

I have already authenticated my remote repository using docker login

Any idea what could be the issue?

P.S. A complete fresh install of Docker Desktop for Mac doesn’t help as well.

OS Version: Macos Sonoma 14.2.1
Docker Desktop for Mac: 24.0.7

It is working for me now, although I am not sure of the root cause.

I did the following:

  1. Uninstall and reinstall of the Docker Desktop → this did not help.
  2. Created a new auth token for Docker and used docker login with the token instead of password → this did not help initially as well.

After some time, without any further change, the images started being pushed.

So I am not clear on what fixed it, but I don’t have the energy to investigate further on the root cause :wink: