Docker build: failed to fetch oauth token for openjdk?

It looks like you have buildkit enabled in your docker configuration. Buildkit is not stable yet and can cause these type of problems. Please try it again with buildkit disabled.

In Linux, using environment variables:

export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0

In Windows and macOS, start the Docker Desktop application, go to Settings, select Docker Engine and look for the existing entry:

"buildkit": true

Change this entry to disable buildkit:

"buildkit": false

Then click on Apply & Restart and try it again.


I have also faced this problem after giving the update to new version on my mac. However I have solved the problem after login from terminal.

The commands were:

docker login

After that I have provided the username and password of docker. The problem was fixed.