`Failed to solve with frontend dockerfile.v0...` how to tackle?

Viewed 11016

I have the following Dockerfile:

# syntax=docker/dockerfile:1
FROM windows
CMD echo Hello World!

I go to the folder where it is contained and run the command:

docker build -t myapp .

Here is the output I am getting:

#1 [internal] load build definition from Dockerfile
#1 sha256:a1d3c4a6e12f4cddf4afffc562b1433934c473851b755b2abc3f2fde935a1a92
#1 transferring dockerfile: 31B done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 sha256:fb211a3db6387cb686b1196a6ecf918d5e247355af1defb5650b7e56a616141b
#2 transferring context: 2B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/windows:latest
#3 sha256:d7ef60db0c57c36d3b2205b072a719bb2fde4c4f6da14ba36cfb712dae5b2314
#3 ...

#4 [auth] library/windows:pull token for registry-1.docker.io
#4 sha256:f2ddcdfd41cd000ab0347326f1abf8fae77a85d55a3cccd4448d5b972ac3e584
#4 DONE 0.0s

#3 [internal] load metadata for docker.io/library/windows:latest
#3 sha256:d7ef62dd0c57c36a3b2205b072b719bb2fde4b7f6ea31ba36cfb723dae5b2314
#3 ERROR: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
------
 > [internal] load metadata for docker.io/library/windows:latest:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

I am very new to Docker, so I can not understand what is causing this error. I do not know how to check if I logged in in Dockedr Hub or not and I do not know how to check if the base image named windows exists.

This question is not helpful at all.

1 My file is called Dockerfile.

2 I do not know what is the buildkit and I do not know where to put the:

export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0

3 I just freshly installed the Docker. I tried this sample application tutorial and it worked just fine for me.

4 As you can see in my Dockerfile I am not trying to copy anything.

Also, I am getting the following error:

$ docker pull mcr.microsoft.com/windows
Using default tag: latest
Error response from daemon: manifest 
for mcr.microsoft.com/windows:latest 
not found: manifest unknown: manifest tagged by "latest" is not found

I can not even pull the servercore/insider:

$ docker pull mcr.microsoft.com/windows/servercore/insider
Using default tag: latest
Error response from daemon: manifest for mcr.microsoft.com/windows/servercore/insider:latest not found: manifest unknown: manifest tagged by "latest" is not found

Even though my local Docker is configured to use the Windows containers:

enter image description here

Feels kind of devastating, I do not know why it does not work and how to fix it.

1 Answers
FROM windows

is not a valid base image on Docker Hub. You can see the pull attempt here:

#3 [internal] load metadata for docker.io/library/windows:latest
...
#3 ERROR: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

For a list of Windows images, I'd look to mcr.microsoft.com, and windows has documented their base images here:

https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-base-images

e.g. for one of the Go images, it uses FROM mcr.microsoft.com/windows/servercore:1809

Related