2

According to that StackOverflow answer:

Yes you can add same location as a volume to many docker containers.

But I read the Docker Volume documention and I can't find where it is said a local volume can safely be shared between several containers on the same host. Could someone point me to an official statement regarding that?

Sylvain Leroux
  • 1,660
  • 2
  • 15
  • 27

1 Answers1

1

By a "local volume" I assume you mean a block device directly attached to the host, such as a "normal" internal disk.

The standard way to run multiple Docker, containers now is Kubernetes, since the demise of Docker Swarm. My reference here is the Kubernetes documentation for Persistent Volumes specifically the table on Access Modes, and the column for ReadWriteMany. A local volume would be a HostPath which is not supported for this use case. However if you were using iSCSI it would support ReadOnlyMany, and if you used NFS you could get ReadWriteMany.

Gaius
  • 1,096
  • 10
  • 18