title: Mounting a container volume into another container on a different path
body: <p>Is it possible to mount a volume from a container into another container on a different path? E.g.</p>
  
  <ul>
  <li><code>contA</code> exposes a volumen <code>/source</code></li>
  <li>mounting it in another container <code>docker run --volumes-from contA -v /source/somedir:/etc/otherdir</code></li>
  </ul>
  
  <p>I'm trying to use this with <code>docker-compose</code> and <a href="https://github.com/jwilder/nginx-proxy" rel="nofollow"><code>jwilder/nginx-proxy</code></a>:</p>
  
  <p><em>docker-compose.yml</em></p>
  
  <pre><code>myapp:
    build: .
    command: ./run.sh
    volumes:
      - /source
  
  nginx:
    image: jwilder/nginx-proxy
    volumes_from:
      - myapp
    volumes:
      - /source/vhost.d:/etc/nginx/vhost.d:ro
      - /var/run/docker.sock:/tmp/docker.sock
    links:
      - myapp:myapp
  </code></pre>
  
  <p>If I'm trying so, I can't see my files at <code>/etc/nginx/vhost.d</code>:</p>
  
  <pre><code>$ docker-compose run nginx bash                                  
  root@f200c1c476c7:/app# ls -l
  total 32
  -rw-r--r-- 1 root root 1076 Apr  9 22:10 Dockerfile
  -rw-r--r-- 1 root root 1079 Apr  9 22:10 LICENSE
  -rw-r--r-- 1 root root  129 Apr  9 22:10 Procfile
  -rw-r--r-- 1 root root 8385 Apr  9 22:10 README.md
  -rw-r--r-- 1 root root 5493 Apr  9 22:10 nginx.tmpl
  root@f200c1c476c7:/app# ls -l /etc/nginx/vhost.d
  total 0
  root@f200c1c476c7:/app# ls -l /source/nginx/
  total 8
  -rw-r--r-- 1 1000 staff 957 Apr 24 07:17 dockerhost.me
  </code></pre>