Docker Community Forums

Share and learn in the Docker community.

Redeploy a service that share volumes


(Cdali) #1

We are currently experiencing an misbehaving: we have three services: “shared”, “fpm” and “nginx”.

“Shared” exposes a volume containing configuration files, fpm contains the application sources and exposes them inside a volume “mounted” by nginx (because assets are provided statically, then nginx will have them locally).

I’m writing a deploy procedure, this includes the sequential redeployment of “fpm” and (later) “nginx”. What happens is that “nginx” almost always mounts the previous version of the “fpm” volume…
Why it happens? How can I avoid it?


(Andrea Giuliano) #2

I have the same exact issue. Can you please help us?


(Nick Breen) #3

I’m experiencing the same issue. Trivial stack file to illustrate:

haproxy:
  image: dockercloud/haproxy:1.2.1
  ports:
    - "80:80"
    - "443:443"
  environment:
    EXTRA_SSL_CERTS: SELF_SSL_CERT
    SELF_SSL_CERT: |
      -----BEGIN PRIVATE KEY-----
      blah...
      -----END PRIVATE KEY-----
      -----BEGIN CERTIFICATE-----
      blah
      -----END CERTIFICATE-----
  volumes:
    - /certs
  roles:
    - global

certs:
  image: ubuntu:trusty
  volumes_from:
    - haproxy
  command: bash -c 'ls -l /certs'

The certs container, despite termination and redeployment, is still mounting an old version of the /certs/ volume from haproxy.


(Nick Breen) #4

Embarrassingly, it was all due to having another container running that also used the volume.