Access file of windows machine from docker container

萝らか妹 提交于 2019-12-06 15:46:29

Of course, you can use volumes.

For example, you can run the following command:

docker run -v path/to/your/file/on/host:path/to/the/file/on/container your_image

The only approach to access the host file is that you can mount the host directory of host system . like if you have

c:\project\test.txt

you can mount c:\project to the docker .

docker run -v c:/project:/src images
By this way you will we able to access the c:project files inside the src folder of the container . or you can create the folder in container and mount it .

And files in container will we accessible to you in /src folder of container and you can do any operation with that file inside the container

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