portainer: [BUG] Extra 'Compose Limited' stack created on deploying Swarm stack

When you creating simple Swarm stack in the Portainer it creates extra ‘Compose Limited’ stack. image

version: '3.9'

services:
  test-service:
    hostname: test-service
    image: zsdima/api:test-service
    networks:
      - public
      - monitor
    ports:
      - 5017:5017
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - ASPNETCORE_ENVIRONMENT=Production
    deploy:
      mode: replicated
      replicas: 1
      restart_policy:
        condition: on-failure
      placement:
        constraints:
          - node.role==manager
      resources:
        limits:
          memory: 1024M
        reservations:
          memory: 128M

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 16

Most upvoted comments

Update:

Upon further investigation, it was found that the following Labels are in the Image upon running sudo docker inspect zsdima/api:test-service

"Labels": {
                "com.docker.compose.project": "testservice",
                "com.docker.compose.service": "test-service",
                "com.docker.compose.version": "2.12.2"

Thanks!

Since no further activity has appeared on this issue it will be closed. If you believe that it has been incorrectly closed, leave a comment mentioning portainer/support and one of our staff will then review the issue. Note - If it is an old bug report, make sure that it is reproduceable in the latest version of Portainer as it may have already been fixed.

We ran into this today in a fashion similar to the above: namely, if any of the base layers of our production images had been built with docker-compose, they would get com.docker.compose.project labels (which are required for docker-compose) and this would cause an extra ‘limited’ stack to be defined in portainer that references the same containers:

image

The solution was to stop using docker-compose (which we like for orderly tracking of build args and other labels that otherwise have to get jammed into one line on a build script). Consequently: any image layers build with docker-compose that later get deployed in a portainer swarm may produce duplicate stacks.

@tamarahenson thanks a lot for looking into With the same project name Portainer still create duplicate stack image image