variable
variable

Reputation: 9724

Does the docker container have a private or shared local drive (C:\, D:\)?

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

Answers (1)

AppyGG
AppyGG

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

Related Questions