2

Here is my docker-compose config file

{ 
  "version": "2",
  "services": {
    "data1": {
        "image": "myimage:v1",
        "volumes": ["/agents"]
    },
    "data2": {
        "image": "myimage:v2",
        "volumes": ["/agents"]
    },
    "app": {
        "image": "app:latest",
        "volumes_from": ["data1", "data2"]
    }
  }
}

Since the volume from both "data1" and "data2" services is at path "/agents", my "app" container will have one of them. Is there a way to specify a different path for each volume that i mount?

pc70
  • 681
  • 1
  • 14
  • 28
  • Sadly, seems like there isn't. There is [some hack](http://stackoverflow.com/questions/23137544/how-to-map-volume-paths-using-dockers-volumes-from) to get it done with the `docker` command. – Dean Fenster Jul 14 '16 at 19:25
  • @DeanFenster, thank you so much for giving honest feedback on where Docker is at with this process. I've been looking for the similar solution so that multiple wordpress instances can run at the same time with their own mounted volumes. Thanks! – klewis Oct 26 '17 at 20:38

0 Answers0