docker-rollout
docker-rollout copied to clipboard
Remanining containers after rollout
My deploy script (sh file) build three images and rollout:
git pull
docker compose build dashboard
docker compose build api
docker compose build website
docker rollout dashboard
docker rollout api
docker rollout website
Sometimes (and I don't know why) there are "remaining" containers after a deployment:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
123026510d16 myapp-website "docker-entrypoint.s…" 6 minutes ago Up 6 minutes 8080/tcp myapp-website-50
123b6fdc1486 myapp-api "docker-entrypoint.s…" 6 minutes ago Up 6 minutes 3000/tcp myapp-api-55
12332ab4c312 myapp-api "docker-entrypoint.s…" 6 minutes ago Up 6 minutes 3000/tcp myapp-api-54
123b3f057175 myapp-api "docker-entrypoint.s…" 6 minutes ago Up 6 minutes 3000/tcp myapp-api-56
123e6157eca8 myapp-api "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 3000/tcp myapp-api-53
1234a67df563 myapp-dashboard "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 8083/tcp myapp-dashboard-48
12315fea426f nginxproxy/nginx-proxy "/app/docker-entrypo…" 2 weeks ago Up 2 weeks 0.0.0.0:80->80/tcp myapp-nginx-proxy-1
I have no idea why it's happening.
Can you share the docker compose file?
@Wowu Thanks for your answer. The repository is open-source, here is the docker compose file: https://github.com/mano-sesan/mano/blob/8e8876f442976eb3ac15775d2e6a94ebe788100a/docker-compose.yml
I think you need to change restart: always
to restart: unless-stopped
, because your containers are restarted when docker-rollout tries to stop them.
restart: unless-stopped
gives you the same auto healing behavior as restart: always
.
I'm also running into this with restart: unless-stopped
when the process dies while running docker rollout.
To replicate:
- docker compose up -d --wait
- docker rollout your-service
- ctrl c after the second instance is up
- docker rollout again
As this is a rather simple script, I'm not sure whether this is really fixable?