Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: ERROR [internal] load metadata for docker.io

On Windows 10, Docker Desktop (Docker Engine v20.10.17, WSL enabled and running properly) fails to docker build an image (that, btw, works properly on Debian 11) throwing following error:

docker build -t <image-name> .
[+] Building 2.3s (3/3) FINISHED
 => [internal] load build definition from Dockerfile                                0.1s
 => => transferring dockerfile: 32B                                                 0.0s
 => [internal] load .dockerignore                                                   0.1s
 => => transferring context: 2                                                      0.0s
 => ERROR [internal] load metadata for docker.io/rocker/r-base:4.2.1                2.0s
------                                                                                                                                                                     > [internal] load metadata for docker.io/rocker/r-base:4.2.1:                                                                                                            ------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize:
rpc error: code = Unknown desc = failed to fetch anonymous token: Get
"https://auth.docker.io/token?scope=repository%3Arocker%2Fr-base%3Apull&service=registry.docker.io":
dial tcp: lookup auth.docker.io: no such host

A similar case was answered here, although the solution doesn't apply in my case. Searching the web yielded several similar (but not identical) cases with different solutions (including a reinstall), which all failed to solve this.

like image 942
bathyscapher Avatar asked Jun 04 '26 05:06

bathyscapher


2 Answers

In the end I found a (or the) solution in the Docker forum: in Docker Desktop, navigate to Settings > Docker Engine, change buildkit to false in the Docker daemon configuration file and then click "Apply & Restart".

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "features": {
    "buildkit": false
  }
}
like image 122
bathyscapher Avatar answered Jun 05 '26 20:06

bathyscapher


Solution:

sudo rm  ~/.docker/config.json 
Rerun restart 
like image 35
Mustafa SAHIN AYDIN Avatar answered Jun 05 '26 19:06

Mustafa SAHIN AYDIN



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!