Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker - ERROR: failed to register layer: symlink

I'm running a docker-compose file we have, I usually run it with command:

docker-compose up

But today I'm getting this error.

ERROR: failed to register layer: symlink ../bdf441e8145a625c4ab289f13ac2274b37d35475b97680f50b7eccda4328f973/diff /var/lib/docker/overlay2/l/7O5XKRTJV6RMTXBV5DTPDOHYNX: no such file or directory
like image 278
CommonSenseCode Avatar asked Jul 06 '17 07:07

CommonSenseCode


People also ask

Should I move/var/lib/Docker/out of the way?

If you have ever run Docker on this host before, or if /var/lib/docker/ exists, move it out of the way so that Docker can use the new LVM pool to store the contents of image and containers.

Where are Docker image layers mounted?

Each container’s writable layer is mounted on a mountpoint in /var/lib/docker/devicemapper/mnt/. An empty directory exists for each read-only image layer and each stopped container. Each image layer is a snapshot of the layer below it. The lowest layer of each image is a snapshot of the base device that exists in the pool.

How do I fix docker-compose error?

I'm running a docker-compose file we have, I usually run it with command: But today I'm getting this error. Show activity on this post. To solve this issue, you just Stop and Start docker service from terminal. Show activity on this post. Followed this answer just restarting docker fixed the problem. Show activity on this post.

How to fix Docker service is not running properly?

The correct way to solve this problem is to move the docker data directory to another location where there is sufficient space. In my case this was my home partition. To do that I had to create a daemon.json file in /etc/docker and add the following lines to it: Then restart the docker service, if you are suing systemd this should be:


1 Answers

For me, this issue came up when I tried to clear the lib/docker/overlay folder by deleting all its contents (not a good thing to do). After that, I was not able to build any of my images back.

Solved it by running this

docker system prune --volumes -a

Warning: This removes all the volumes and its contents which may result in data loss. Which was fine for me since I already deleted everything.

like image 93
Shankar Thyagarajan Avatar answered Nov 02 '22 10:11

Shankar Thyagarajan