Duplicated compose stack while using swarm #9926
Replies: 9 comments
-
Thank you for the information. I am going to further investigate. I will update you as I learn more. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@AndBondStyle |
Beta Was this translation helpful? Give feedback.
-
@samdulam that doesn't conflict with what I said. As a workaround I suggested that, if container has both |
Beta Was this translation helpful? Give feedback.
-
@AndBondStyle |
Beta Was this translation helpful? Give feedback.
-
hello "com.docker.stack.namespace" is working well for that. |
Beta Was this translation helpful? Give feedback.
-
This is in our backlog and no ETA at this stage.
|
Beta Was this translation helpful? Give feedback.
-
is there any update on this topic? |
Beta Was this translation helpful? Give feedback.
-
An other workaround, use classic builder with
|
Beta Was this translation helpful? Give feedback.
-
This is very confusing on Swarm, I have my container displaying wrong stack as com.docker.compose.project, my service with correct com.docker.stack.namespace, stack duplicated with com.docker.stack.namespace and com.docker.compose.project. I understand that we can have mixed environment but it should deal with both correctly. It's a bug, not a feature. |
Beta Was this translation helpful? Give feedback.
-
Bug description
When image is built using docker compose, it is assigned compose-specific labels like
com.docker.compose.project
,com.docker.compose.service
and others. And when the same image is used withdocker stack deploy
, the resulting swarm-managed container also inherits those labels (alongside with swarm labels likecom.docker.swarm.service.name
). This results in portainer displaying two stacks: swarm and compose, with shared container instance inside them. I think it's at least annoying and confusing (and probably conceptually incorrect), because compose can't manage swarm containers and vice versa, therefore for any given container there always should be only one stack that it belongs to? My suggestion is to add an exclusion condition when assigning stacks, so if there iscom.docker.swarm.*
andcom.docker.compose.*
, swarm should take priority, and be the only one stack that's displayed.Example of mixed container labels (built with compose, deployed with swarm):
Steps to reproduce the issue:
docker compose build
+docker compose push
docker stack deploy ...
(using the same compose file is probably the most common scenario)Technical details:
Beta Was this translation helpful? Give feedback.
All reactions