How Containers get access to data in volumes stored and managed by docker in host machines?

I am a newbie in learning Docker. AFAIK, containers comprise of chroot, namespaces and cgroups. Since the containers are built these ways, I am pretty sure that containers are very isolated and don’t get access to host systems, that’s the nature of containers by the way. Only the host systems can control the containers. So my doubt is that, how can containers persist state using volumes present in host systems. How can they even access it?

A container only knows volumes assigned to it. Volumes can be docker named volumes or simple mount binds. Docker named volumes rely on the capabablities of docker volume plugins that range from support for remote shares or block device approaches specific to cloud/storage vendors or products.

The embedded local driver has support for remote cifs and nfs shares, as well as support for local mount binds.

1 Like