Answers: <p>By a "local volume" I assume you mean a block device directly attached to the host, such as a "normal" internal disk. </p>
  
  <p>The standard way to run multiple Docker, containers now is Kubernetes, since the demise of Docker Swarm. My reference here is the Kubernetes <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistent-volumes" rel="nofollow noreferrer">documentation for Persistent Volumes</a> specifically the table on Access Modes, and the column for <em>ReadWriteMany</em>. A local volume would be a <em>HostPath</em> which is <em>not</em> supported for this use case. However if you were using iSCSI it would support <em>ReadOnlyMany</em>, and if you used NFS you could get <em>ReadWriteMany</em>. </p>
  
Answers: CC BY-SA 4.0
Answers: 2019-03-04T00:37:20.440Z
Answers: Searching for the demise of swarm I can only find articles that say that Swarm isn’t demised it is simply that Docker EE will also support k8s. Do you have an official link that says otherwise?
Answers: simbo1905
Answers: CC BY-SA 4.0
Answers: 2019-03-02T15:15:34.847Z
Answers: 2019-03-02T15:15:34.847Z
Answers: Gaius
Body: <p>According to <a href="https://stackoverflow.com/a/42855234/2363712">that StackOverflow answer</a>:</p>
  
  <blockquote>
    <p>Yes you can add same location as a volume to many docker containers.</p>
  </blockquote>
  
  <p>But I read the <a href="https://docs.docker.com/storage/volumes/" rel="nofollow noreferrer">Docker Volume documention</a> and I can't find where it is said a <em>local</em> volume can safely be shared between several containers on the same host. Could someone point me to an official statement regarding that? </p>
  
Comments: CC BY-SA 4.0
Comments: 2019-02-26T15:39:17.840Z
Comments: It is the same as sharing the same directory between multiple process. /var/log is usually written into by multiple process in a system.
Comments: Tensibai
Comments: CC BY-SA 4.0
Comments: 2019-02-26T18:06:53.057Z
Comments: Well, what confuses me @Tensibai is volumes are _mounted_ several times. Given the way the Linux kernel handles mounts, it isn't a problem to mount the same device at different locations. But is this just a happy consequence of that, or a supported feature guaranteed to work the same on non-Linux Docker platforms (ie, with Windows Native containers)?
Comments: Sylvain Leroux
Comments: CC BY-SA 4.0
Comments: 2019-02-27T07:37:51.117Z
Comments: Technically, they are only mounted once in each container, and at the end of the day, that's not a real mount, that's more a hole in the name spaces where a process in namespace A is allowed to access filesystem in 'host' namespace
Comments: Tensibai
Comments: CC BY-SA 4.0
Comments: 2019-02-27T09:48:41.213Z
Comments: Define "safe". Will it work? Yes. Will you get problems if multiple containers read/write the same set of files? Yes.
Comments: Raphael
Tags: <docker><volume>
Title: Where is it said I can safely the same local volume to multiple docker containers?
UserDisplayName: Sylvain Leroux
ThreadText: # Where is it said I can safely the same local volume to multiple docker containers?
  
  (Asked by: username_0 on 2019-02-26)
  
  According to [that StackOverflow answer](https://stackoverflow.com/a/42855234/2363712):
  
  > Yes you can add same location as a volume to many docker containers.
  
  But I read the [Docker Volume documention](https://docs.docker.com/storage/volumes/) 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?
  
  **Tags:** docker, volume
  
  > **Comments:**
  > **username_1**: It is the same as sharing the same directory between multiple process. /var/log is usually written into by multiple process in a system.  
  > **username_0**: Well, what confuses me @username_1 is volumes are _mounted_ several times. Given the way the Linux kernel handles mounts, it isn't a problem to mount the same device at different locations. But is this just a happy consequence of that, or a supported feature guaranteed to work the same on non-Linux Docker platforms (ie, with Windows Native containers)?  
  > **username_1**: Technically, they are only mounted once in each container, and at the end of the day, that's not a real mount, that's more a hole in the name spaces where a process in namespace A is allowed to access filesystem in 'host' namespace  
  > **username_2**: Define "safe". Will it work? Yes. Will you get problems if multiple containers read/write the same set of files? Yes.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-03-02. Score: 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](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#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*.
  
  > **Comments:**
  > **username_4**: Searching for the demise of swarm I can only find articles that say that Swarm isn’t demised it is simply that Docker EE will also support k8s. Do you have an official link that says otherwise?  
  
  ---
  
  