Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run or delete images or container (fail overlay2)

Tags:

docker

When I want to delete all my container I see that error

Command:

docker rm $(docker ps -aq)

the error is:

Error response from daemon: driver "overlay2" failed to remove root filesystem for 4bf2fc329d2fab3c055dd136a740c5ee2000e35e26fea6a38c94801fd8dfb109: remove /var/lib/docker/overlay2/7991f36adaa25d4046ef6106c3da8bbbb1f3ce7478b07a30021669a7783b4b6c/diff/root/.ipython: read-only file system

Also I have tried

docker rm -f $(docker ps -aq)

But the result was the same

Also I have tried to delete that image:

docker rmi -f <images_id>

And the result was the same.

How can I delete the container?

like image 208
Andrey Berenda Avatar asked Jun 02 '18 04:06

Andrey Berenda


People also ask

How do I clean up docker overlay2 folder?

How To Clean Up Docker Overlay2? In order to clean up unused containers and images, we can use the docker system prune. A prune will never remove consists of: Operational containers.

Can I delete docker overlay2 files?

You can clean what is unused but you should never remove data manually from /var/lib/docker/volumes and/or /var/lib/docker/overlay2. Manually deleting files under /var/lib/docker can result in data loss. Read the Docker command line reference before running any of these commands.

What is docker overlay2?

overlay2. overlay2 is the preferred storage driver for all currently supported Linux distributions, and requires no extra configuration. fuse-overlayfs. fuse-overlayfs is preferred only for running Rootless Docker on a host that does not provide support for rootless overlay2 .


1 Answers

Check what your filesystem is: moby/moby issue 9939 reports:

Does the overlay2 driver work on a btrfs file system?
The documentation says only ext4 and xfs are supported.

See also if docker system prune can help.

Restarting the computer, to clear any locked file can help too.

like image 167
VonC Avatar answered Sep 27 '22 22:09

VonC