Score:0

How to remove stuck containers if docker won't start? (due to stuck containers)

it flag

I have some containers that appear to be stuck.

I have managed to get dockerd stopped.

Trying to do:

systemctl start docker just hangs.

I then tried:

dockerd --debug

And I get a ton of messages like failed to exit within 10 seconds of signal 15 and failed to exit within 10 seconds of kill.

I don't want docker to try and do anything with these containers, I just want to nuke them. I can't even do docker ps, it just hangs.

So...I need docker to be running in order to remove these broken containers, but I can't start docker as long as these containers exist.

What do I do here? How do I remove containers if dockerd can't start?

Score:0
cn flag

This is my goto sequence for getting Docker unstuck. In my experience this tends to happen now and then on a docker package upgrade if your containers are set to autostart and sometimes after OOM kills of containers.

Your system may differ in specifics.

killall containerd-shim
service containerd restart
rm -rf -- /var/run/docker/runtime-runc/moby/*
service docker restart
Score:0
tr flag

You could mount the directory where the containers are and then delete the containers via "rm [filename]".

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.