Docker Community Forums

Share and learn in the Docker community.

Need help figuring out a dockerfile

Hello Folks,

I’m new to docker and i’m experimenting with docker on Windows Server 2016.

I have the following docker file:


FROM microsoft/nanoserver
COPY C:\source\Sample2\packages\ c:\packages
COPY C:\source\Sample2\packages\Unattend.xml c:\packages
RUN dism /online /apply-unattend:c:\packages\unattend.xml
COPY content /inetpub/wwwroot/

i am trying to build the images using PowerShell with the following command:

get-content dockerfile | docker build -t /dotnettestapp -

i keep getting an error on the COPY. i tried multiple ways no success

Step 1/5 : FROM microsoft/nanoserver
—> 787d9f9f8804
Step 2/5 : COPY C:\source\Sample2\packages\ c:\packages
GetFileAttributesEx The system cannot find the file specified.
PS C:\source\sample2>

Any help would be greatly appreciated .


The source for COPY instructions is is path-relative to where your build context is:

ran the docker build command in a command prompt instead of powershell using “docker build -t pierreroman/iis-dockerfile C:\source\Sample2” and it worked. the copy error went away.