ILikeTacos
ILikeTacos

Reputation: 18676

How to build windows server core on Windows 10 Pro?

I have the following basic Dockerfile:

FROM mcr.microsoft.com/windows/servercore:1903
CMD echo Hello World!

When I run the command:

docker build -t latest . or docker build .

My terminal hangs forever and it seems like nothing is being done.

However, if I run:

docker pull mcr.microsoft.com/windows/servercore:1903

I can pull the image from the repository.

I'm not sure what I'm doing wrong, or how to fix it. The build command doesn't seem to have a verbose option, and I need a docker container running Windows.

I'm using Docker in Windows 10 Pro and its configured to use Windows containers.

Upvotes: 1

Views: 449

Answers (1)

Gregory Suvalian
Gregory Suvalian

Reputation: 3832

Check which directory do you execute your commands from. You shall be executing them from directory where DOCKERFILE is located and nothing else. If you execute say from root of C drive or any other location with big number of files then docker as a first step will try to zip all of them up and then send to a builder and hence delays.

Upvotes: 1

Related Questions