Docker Community Forums

Share and learn in the Docker community.

Ability to use external volumes on a swarm service

aws

(Basi) #1

I’m facing a problem when I try to deploy a service that uses rexray volume in a swarm (swarm mode) cluster on AWS.

I have previously created a rexray volume that I’m trying to attach to the service:

$ docker volume ls
DRIVER              VOLUME NAME
rexray              packagist

Then when I try to use it in a service it does not work:

$ docker service create --name satis-packagist \
  --mount type=volume,volume-driver=rexray,source="packagist",target=/satisfy/web/ \
  localhost:5000/satis/packagist
$ docker service ls
ID            NAME              REPLICAS  IMAGE                              COMMAND
6tw84yv7g24k  satis-packagist   0/1       localhost:5000/satis/packagist

I don’t know how to debug it, I’ve not seen anything on “docker events”, neither on logs on any node of the cluster.
I’m sure that the problem is related with the volume because when I remove the mount line it works as expected:

$ docker service create --name satis-packagist \
  localhost:5000/satis/packagist
$ docker service ls
ID            NAME              REPLICAS  IMAGE                           COMMAND
ewr9lv9shr1b  satis-packagist   1/1       localhost:5000/satis/packagist

And I can check the container logs as usual.

The volume is available and correct because if I launch it via docker run it works correctly.

$ docker run --rm --name satis-packagist \
  --volume-driver=rexray -v packagist:/satisfy/web/ \
  localhost:5000/satis/packagist

(Basi) #2

Hi, I’ve seen that this behaviour has been fixed in the stable 1.12.1 version. Now it works perfectly, but changing the naming from source to src and target to dst, as it was changed during RC development.