0

I'm using docker swarm to run containers. I need some of my containers to have privileged rights, and the way achieve this with docker swarm is to use Docker in Docker. So my services utilize the docker image and then start the image I want to use with privileged rights when they start. However, when I remove my services, the inner docker containers are left running.

Is there a way to remove these dangling containers automatically when the service that starts them is removed? I can manually kill the containers by checking their ids with docker ps and then use docker kill, but that it is far from optimal.

Alqio
  • 452
  • 1
  • 5
  • 15
  • surely, dind is the actual service that you are scheduling, and consequently would manage. And the privileged container is just its child. otherwise, a healtcheck that is the count of containers could suffice? – Chris Becke Oct 18 '22 at 13:13

0 Answers0