Docker Community Forums

Share and learn in the Docker community.

Cannot scale service which mounts volumes from another service


(Ali) #1

Hi all,

If a Docker Cloud service mounts volumes from another service, it seems it cannot be scaled to more than a single container using target_num_containers. Here’s an example docker-cloud.yml:

  image: alpine
  target_num_containers: 2
    - data

  image: alpine
    - /bar

Trying to deploy this stack:

$ docker-cloud stack up -n foo
# create stack works, deploy does not work

$ docker-cloud stack update foo
# works

$ docker-cloud stack redeploy foo
Status 422 (POST Response: {"error": "Service 'foo': 'volumes_from' data not found for foo-2"}

My expectation is that each service deploys successfully, and both ‘foo’ containers mount the single volume from the data container. So is there a reason this configuration does not work, or is it an error with Docker Cloud?


PS: You need to add “command: /bin/true” to both services to reproduce the issue, I removed them to keep the example minimal.

(Ali) #2

Am I approaching this the wrong way?

I would think this is a typical use case; scaling up some service which also mounts external volumes. So I’m a bit surprised no one has replied here, and almost certain it must be me doing something wrong.

Would love to hear from anyone, whether you are wondering the same issue or can explain where I’m going wrong. Thanks :slight_smile:

(Pmendes) #3

+1. Having the same issue and can’t seem to find a solution

(Kenny Lim) #4

Hi there,

Mounting single volume container (data container, in your case) on multiple containers (foo) is not possible on Docker Cloud as of now. I would suggest that you use host volumes instead.


(Bosco Mutunga) #5

Any indication of when support for this feature will be available?

(Harryted) #6

I am also keen on this feature