Docker Community Forums

Share and learn in the Docker community.

How can I reinit docker layers?

Using docker under Kubuntu 18 I got out of free space on the device.
I run commands to clear space:
docker stop $(docker ps -a -q)

docker rm $(docker ps -a -q)
docker-compose down --remove-orphans
docker system prune --force --volumes

As I was still of free space opened /var/lib/docker/overlay2/ directory and
deleted a lot of subdirectories ubder it.

After that I got error :
$ docker-compose up -d --build
Creating network “master_default” with the default driver
ERROR: stat /var/lib/docker/overlay2/36af81b800ebb595a24b6c724318c1126932d2bfae61e2c98bfc65a203b2b928: no such file or directory

  1. Looks like that is not a good way to free space. Which way isd good in my case?
  2. If there is a way to reinit my docker apps?


To repair, the best you can do is backup anything you want to save, particularly any volumes, stop the docker engine ( systemctl stop docker ), delete the entire docker filesystem ( rm -rf /var/lib/docker ), and restart docker ( systemctl start docker ).