-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker-Compose + Swarm : Problem when trying to deploy twice the same stack on two different Node using different constraint. #1562
Comments
The prepended id happend when we try to recreate a conatiner. We rename it with this prepended id, then copy the volumes over, then remove it. Sometimes the remove fails, which leaves this weirdly named container around. |
I having the same problem
Any work around? |
I appear to be experiencing but without the complication of an environment file. |
@dnephin |
I'm going to close this issue as a duplicate of #2866 since the problem desciption in that issue reflects the problem more directly. There is a discussion in the issue about the problem. |
Hello, I am trying to use Swarm + Docker-Compose to deploy a stack of services meant to be running and talking to each other on the same physical host.
I have a A/B type of environment, where I would like to deploy version X on Node1 while deploying version Y of the stack on Node2.
What I have discovered so far is that I can safely deploy the stack on either of the Nodes (1|2) as long as the other Node isn't running the same stack.
Before I start into greater details here are some details about the tools I am using.
Docker Compose Version
Docker Swarm Version
Here are the details of my two nodes with their respective labels.
Node1: pod=B & service=srbk
Node2: pod=A & service=srbk
Starting fresh
I ran the following docker-compose file
where the env_file looks like this
Now when running docker-compose I end up with the following (so far so good, everything gets downloaded and started started!)
Question #1:
Why is the images downloaded on all nodes even though I have a valid constraint that applies to Node2 only ?
Question #2:
Why is the 2nd container ends up with 4 different container names while
the 3rd container ends up with 7 different container names.
Now if I look at the PS for the other docker-compose file (that one that should deploy on Node1), I get the list of running container on Node2
Trying to run the POD B docker-compose file I get the following error.
Full output
Also everytime I rerun the command the name of the container that it is trying to recreated gets prepended an ID
double ID (etc)
From what I can see, docker-compose is trying to keep the existing previously lined container as part of the affinity hence forcing the newly recreated container to be on the original Node2 (BUT since the new docker-compose file is specifying a different env_file, we get conflicting label constraint.)
Let me know if there is something (hacky or not) that I could do to prevent this from occurring ! :)
PS: Sorry for the double post: docker-archive/classicswarm#970
The text was updated successfully, but these errors were encountered: