title: How to mirror docker volumes in host machine
body: <p>As far as I understand, we have 3 kinds of entities:</p>
  <ol>
  <li>Containers</li>
  <li>Host</li>
  <li>Volumes</li>
  </ol>
  <p>We can map</p>
  <ol>
  <li>a host directory to one or more containers</li>
  <li>a volume to one or more containers</li>
  </ol>
  <p>but how about maping a volume to one or more directories on the host machine? so we can effectively create multiple live mirrors of the volume?</p>
  <p>Here's my last attempt:</p>
  <p><strong>docker-compose.yml</strong></p>
  <pre><code>version: '2'
  services:
    mirroring-container:
      image: nginx
      volumes:
        - important-data:/home
        - ./mirror1:/home
        - ./mirror2:/home
        - ./mirror3:/home
  volumes:
    important-data:
  </code></pre>
  <p>I was expecting that this way, any files created inside the /home directory in the nginx container will also be created in 4 other locations:</p>
  <ol>
  <li>important-data volume</li>
  <li>folder mirror1 in the host directory containing the docker-compose.yml</li>
  <li>folder mirror2 in the host directory containing the docker-compose.yml</li>
  <li>folder mirror3 in the host directory containing the docker-compose.yml</li>
  </ol>
  <p>However, for some reason, docker ignored all of these except the last one. Once I created a file in the /home directory of the container, it was created only in the mirror3 folder, it wasn't event created in the volume.</p>