Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access file of windows machine from docker container

I have installed Docker Desktop for Windows in Windows 10 operating system. I am running a python script inside docker container which reads file from disk and add few text at the end of files. Now the requirement is to read files from Windows 10 and perform the same operation on it.

Is it possible in docker to read files from OS on top of which Docker is running?

like image 865
Rakesh K Avatar asked Jul 23 '17 16:07

Rakesh K


1 Answers

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
like image 200
D. Gonçalves Avatar answered Oct 18 '22 10:10

D. Gonçalves