1

I have followed these steps and when I run PS C:\dockeragent> docker build -t dockeragent:latest .

I get

[+] Building 0.8s (3/3) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 31B                                                                                0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => ERROR [internal] load metadata for mcr.microsoft.com/windows/servercore:ltsc2019                               0.7s
------
 > [internal] load metadata for mcr.microsoft.com/windows/servercore:ltsc2019:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:etcetc: not found

I am using VSC with Docker extention on my local computer. How can I build this image?

user16908085
  • 95
  • 10

1 Answers1

1

From the log, the image is build from a windows image(windows/servercore:ltsc2019).

You need to check if the docker desktop on your local machine is running on Windows containers.

If no, you need to switch it to Windows containers.

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28
  • Yes you're right, I ran docker version and found it is running on OS/Arch: linux/amd64. I thought I had created Windows containers, so how do I switch? – user16908085 Sep 15 '21 at 06:42
  • Are you using docker desktop? – Kevin Lu-MSFT Sep 15 '21 at 06:56
  • Please refer to this ticket: https://stackoverflow.com/questions/57081352/docker-command-line-to-switch-to-running-linux-containers-on-windows-core-machin and https://stackoverflow.com/a/67007851/13464420 – Kevin Lu-MSFT Sep 15 '21 at 06:59
  • Yes I am. I have been reading through the documentation (at the docker engine part for the moment) but I am too new to this. – user16908085 Sep 15 '21 at 07:00
  • You can refer to the tickets above and do the change . Then you can check if it can work for you. Feel free to let me know if you have any further questions – Kevin Lu-MSFT Sep 15 '21 at 07:03