Closed rmelick closed 5 years ago
volumes_from
still forces the container to be scheduled on the same node (this is enforced by swarm), so I don't expect it to work.
Note that this is not an issue with compose, it's an issue with swarm. Volumes referenced need to be on the same node. Often this is because swarm can't schedule all of the required volumes (and their respective containers) on the same node due to capacity issues, and therefore can't fulfill the volumes_from
request.
This is basically the same issue as #2866 (which was fixed in #2894). I was hoping that using volumes_from would allow the container to be successfully recreated, but that seems to not be the case.
What I Have
Full project is available on github: https://github.com/rmelick/docker-compose-up
Docker Versions
Swarm Cluster
swarm/swarm.sh create
)Docker images
I have two example images.
The data-container, which contains a volume that will be mounted by the app container using volumes_from
The app-container
What I Do
With the following docker-compose file (also available at https://github.com/rmelick/docker-compose-up/blob/master/docker-compose.yml)
I run the following
What I Expected
I expected the app container to be recreated successfully
What Happened Instead
I saw the following error
The full log from a different run with --verbose is attached: docker-compose-log.txt
Question
The comments in #2866 and #2894 implied this failure would happen if my app container had volumes that needed to be copied over to its replacement instance during the --force-recreate. But, the only volume it's using is the read only volume supplied by the data container. It would be totally ok to recreate my app container without copying any volumes, right?