问题
I am trying to create a Windows Nano Server container and copy some files from server to the new container. Below is my dockerfile code:
FROM microsoft/nanoserver
MAINTAINER test@gmail.com
COPY C:/files/ C:/files/
When I run it, I am getting below error:
Copy failed:createFile \?\c:\programdata\Docker\tmp\docker-builder78565487\files: The system canot find the path specified.
How do I declare source location in COPY
command, so it uses absolute path and copy files to c:\files location on my container.
回答1:
You can not copy files outside of context of the build. Move files which needs to be copied in the same folder where dockerfile
is.
https://docs.docker.com/engine/reference/builder/#copy
来源:https://stackoverflow.com/questions/48392029/how-to-copy-files-from-server-to-docker-container