Sharing volumes
While sharing a folder with a container we use a physical path available on the host machine such as C:\temp. If we try to create another container with the same physical path, it does not mean containers share the same physical folder c:\temp. This is because every time we attach a volume to a container, Docker creates a new folder under c:\programdata\docker\volumes so physical storage paths on the host shared across containers are not physically shared. Does that mean we cannot share volumes across containers? No: Docker provides a special way to share volumes across containers using named volumes; we can point multiple containers to the same named volume so that the files can be shared. This is possible because named volumes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access