title: How do you share volumes between Docker containers in an Elastic Beanstalk application?
body: <p>I'm trying to share data between <strong>two Docker containers</strong> that are running in a multicontainer AWS EC2 instance.</p>
  
  <p>Normally, I would specify the volume as a command flag when I ran the container, ie: <code>docker run -p 80:80 -p 443:443 --link Widget:Widget --volumes-from Widget --name Nginx1 -d nginx1</code> to share a volume from Widget to Nginx1.</p>
  
  <p>However, since Elastic Beanstalk requires you to specify your Docker configuration in a <code>dockerrun.aws.json</code> file, and then handles running your docker containers internally, I haven't been able to figure out how to share data volumes between containers.</p>
  
  <p><strong>Note that I'm not trying to share data from the EC2 instance into a Docker container</strong> -- this part seems to work fine; rather, I would like to share data directly from one Docker container to another. I know that docker container volumes are shared with the host at <code>"/var/lib/docker/volumes/fac362...80535"</code> etc., but since this location is not static I don't know how I would reference it in the <code>dockerrun.aws.json</code> file.</p>
  
  <p>Has anyone found a solution or a workaround?</p>
  
  <p>More info on <code>dockerrun.aws.json</code> and the config EB is looking for here: <a href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html" rel="nofollow">http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html</a></p>
  
  <p>Thanks!</p>