简体   繁体   中英

How to copy files from server to docker container

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM