Docker Community Forums

Share and learn in the Docker community.

Docker file - COPY fails


(Rongalooli) #1

Hi,
I have the following docker file:
######################################################################

FROM microsoft/wcf:4.7

RUN mkdir C:\WcfServiceTest

RUN powershell -NoProfile -Command
Import-module IISAdministration;
New-IISSite -Name “WcfServiceTest” -PhysicalPath C:\WcfServiceTest -BindingInformation “*:100:

EXPOSE 100

COPY /Publish/ C:\WcfServiceTest
######################################################################
(from https://wannabeegeek.com/2017/07/10/running-wcf-microservices-in-windows-containers/)

Which worked fine, and still works fine on our CD server, but when I try to run on my own box I get the following:

docker build -t reporting .

Sending build context to Docker daemon 197.2MB
Step 1/5 : FROM microsoft/wcf:4.7
—> cd18345410e8
Step 2/5 : RUN mkdir C:\WcfServiceTest
—> Using cache
—> 313ff565562c
Step 3/5 : RUN powershell -NoProfile -Command Import-module IISAdministration; New-IISSite -Name “WcfServiceTest” -PhysicalPath C:\WcfServiceTest -BindingInformation “*:100:
—> Using cache
—> 64d71b6e4ca8
Step 4/5 : EXPOSE 100
—> Using cache
—> 99edb36f39ec
Step 5/5 : COPY /Publish/ C:\WcfServiceTest
failed to copy files: failed to copy directory: mkdir \?\Volume{278c3e2d-8e7e-4788-87ea-e1210e1d8108}\C:WcfServiceTest: The directory name is invalid.

Docker version 18.06.0-ce, build 0ffa825

Any ideas?
the path i s created according to step 2, so why does it fail to copy the files to it?

Thanks,
Ron


(Ishwarchincholkar) #2
FROM microsoft/wcf:4.7

RUN  mkdir  C:\\WcfServiceTest

RUN powershell -NoProfile -Command 
Import-module IISAdministration; 
New-IISSite -Name “WcfServiceTest” -PhysicalPath C:\\WcfServiceTest -BindingInformation “*:100:”

EXPOSE 100

COPY //Publish// C:\\WcfServiceTest\\

You should use double // instead of single /