I want to build a Docker image including my custom Powershell modules. Therefore I use Microsofts microsoft/powershell:latest
image, from where I wanted to create my own image, that includes my psm1 files.
For simple testing I've the following docker file:
FROM microsoft/powershell:latest
RUN mkdir -p /tmp/powershell
COPY C:/temp/somedirectory /tmp/powershell
I want to copy the files included in C:\temp\somedirectory to the docker linux container. When building the image I get the following error:
C:\temp\docker_posh> docker build --rm -f Dockerfile -t docker_posh:latest .
Sending build context to Docker daemon 2.048kB
Step 1/3 : FROM microsoft/powershell:latest ---> 9654a0b66645
Step 2/3 : RUN mkdir -p /tmp/powershell ---> Using cache ---> 799972c0dde5
Step 3/3 : COPY C:/temp/somedirectory /tmp/powershell COPY failed: stat /var/lib/docker/tmp/docker-builder566832559/C:/temp/somedirectory: no such file or directory
Of course I know that Docker says that I can't find the file/directory. Therefore I also tried C:/temp/somedirectory/.
, C:/temp/somedirectory/*
, and C:\\temp\\somedirectory\\
as alternativ source paths in the Dockerfile -> Result: none of them worked.
docker version
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:05:22 2017
OS/Arch: windows/amd64
Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:12:29 2017
OS/Arch: linux/amd64
Experimental: true
How can I copy a folder including subfolder and files via a Dockerfile?