How to copy files from server to docker container

流过昼夜 提交于 2020-01-06 06:19:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!