Building docker image for linux on windows server 2019 fails

680 views Asked by At

We are building a .net 5.0 gRPC service and using the below command trying to create docker image for linux on my dev machine (windows 10 with Docker Desktop) works just fine:

docker build --platform=linux . -t repo:imagename --no-cache

the issue is that our CI/CD pipeline uses windows server 2019 and Docker desktop cannot be installed, so I followed this:

Docker Linux Container running on Windows Server 2019

and that seems to work to run linux images on the server but not to build them? Is this even possible?

docker version gives:

enter image description here

you can see that the OS/Arch is windows for the docker server and even using lcow cannot get it to be linux

so building gives the following error:

failed to get destination image "sha256:guid": image with reference sha256:guid was found but does not match the specified platform: wanted linux/amd64, actual: windows/amd64

Any help is appreciated

0

There are 0 answers