Docker: mounting volumes from other docker service (not container)

I have two hosts that run docker service on each host.

Container from host A wanted to uses volume that created from host B.

  • How to change “remote process types” for Heroku deploy with Docker
  • Install composer dependencies while deploying
  • Docker installation
  • Download size of docker images
  • how to start a docker container along-with its parameters changed?
  • Pass commands from one docker container to another
  • Is this possible?

  • How to automatically remove container data from the host when rm the container?
  • Error initializing network controller in docker daemon
  • How to upload next version of code on amazon AWS which has docker instance?
  • PHP application moving to Docker failed to connect on AWS
  • Docker Java Image cannot connect to Docker Mongo
  • In which branch should I build a docker image?
  • One Solution collect form web for “Docker: mounting volumes from other docker service (not container)”

    noops, both services should be on the same host but there is one thing you can do.

    All reused data volumes are mounted on the same paths as in the source
    service. Containers must be on the same host in order to share
    volumes, so the containers of the new service will deploy to the same
    nodes where the source service containers are deployed.

    https://docs.docker.com/docker-cloud/apps/volumes/

    Possible solution:

    1. mount volume to a host directory
    2. sync that directory between your nodes

    You can use NFS to sync directories on all nodes, i have used it myself works fine

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.