As usual, if you want to use Ubuntu with Dockerfile on Docker for windows, I got an error and couldn't build. I'll look it up, but it didn't come out very often, so I'll leave it as a memorandum. The rough environment is as follows. ・ Windows 10 pro ・ WSL2 (ubuntu18.04) ・ Docker for windows
docker build -f ./Dockerfile -t test .
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%3alibrary%2fubuntu%3apull&service=registry.docker.io: dial tcp: lookup auth.docker.io on [::1]:53: read udp [::1]:37977->[::1]:53: read: connection refused
Open Docker for windows I changed the settings of Docker Engine as follows and restarted docker and it was cured.
Change before
{
"registry-mirrors": [],
"insecure-registries": [],
"debug": false,
"experimental": false,
"features": {
"buildkit": true
}
}
After change
{
"registry-mirrors": [],
"insecure-registries": [],
"debug": false,
"experimental": false
}
The article I referred to is here.