Reputation: 9724
Do docker containers share the local drive of the host OS?
Or do they have an independent storage.
If my code tries to read a file from "C:\users\test_user\file_name.txt", then how does the file path resolution work? What is the concept here?
Upvotes: 0
Views: 49
Reputation: 382
If you want to share folders of files with a container you can map it with a volume
example :
volumes:
- /home/dev:/home/wwwroot
# ^^^ ^^^
# host : container
# or
#
volumes:
- C:\users\test_user\file_name.txt:/home/wwwroot/file_name.txt
Container are isolated from your host system. See documentation for more : https://docs.docker.com/storage/
Upvotes: 1