How to remove docker container even if root filesystem does not exists?

Viewed 16537

I have one container that is dead, but I can't remove it, as you can see below.

How can I remove it? Or how can I clean my system manually to remove it?

:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
78b0dcaffa89        ubuntu:latest       "bash -c 'while tr..."   30 hours ago        Dead                                    leo.1.bkbjt6w08vgeo39rt1nmi7ock

:~$ docker rm --force 78b0dcaffa89
Error response from daemon: driver "aufs" failed to remove root filesystem for 78b0dcaffa89ac1e532748d44c9b2f57b940def0e34f1f0d26bf7ea1a10c222b: no such file or directory
4 Answers

Its possible Docker needs to be restarted.

I just ran into the same error message when trying to remove a container, and restarting Docker helped.

I'm running Version 17.12.0-ce-mac49 (21995)

To restart Docker, go to "Preferences" and click on the little bomb in the upper right hand corner.

In my situation I have Docker running off of a expansion drive on my MacBook. After coming out of sleep mode, the expansion drive was automatically ejected (undesirable). But after mounting the drive again, I realized Docker needed to be restarted in order to initialize everything again. At this point I was able to remove containers (docker rm -f).

Maybe its not the same situation, but restarting Docker is a useful thing to try.

Let me share how I got here. My disk on the host was getting full while working with docker containers, ended up getting failed to remove root filesystem myself as well. Burned some time before I realized that my disk is full, and then also after freeing up some space, with trying to restart docker. Nothing worked, only closing everything and rebooting the machine. I hope you'll save some time.

Related