3

There is a broken image which blocks further pulls. And I cannot remove or delete it

What I did:

- stopped all containers ("docker ps -a" shows empty list)
- cleaned everything with "docker system prune -a")
- "docker image ls -a" shows an empty list

When I pull something based on PHP7.3 I get this error:

$ sudo docker pull wordpress
Using default tag: latest
latest: Pulling from library/wordpress
bc51dd8edc1b: Already exists 
a3224e2c3a89: Already exists 
be7a066df88f: Already exists 
bfdf741d72a9: Already exists 
a9e612a5f04c: Already exists 
c026d8d0e8cb: Already exists 
d94096c4941c: Already exists 
5a16031a7587: Already exists 
0cf1daf9efc0: Already exists 
b202acb13a6c: Already exists 
907001e30880: Already exists 
2e4b329c80b2: Already exists 
cd1ec92e7164: Already exists 
8cba435f5ca6: Already exists 
42d9ff86311d: Extracting [==================================================>]   16.7MB/16.7MB
4907cef4e3ab: Download complete 
d9efb2f24248: Download complete 
8301b0ae2103: Download complete 
a9e295ae3552: Download complete 
cd1a22f91cdc: Download complete 
f81677d558c1: Download complete 
failed to register layer: error creating overlay mount to /var/lib/docker/overlay2/081694acd847bf622c20fa32b7cebad1ca46d4848cd49c336812fc03d60457c5/merged: too many levels of symbolic links

I am wondering about "already exists": How to delete them?? (I already tried prune -a ; see above)

I wish I could delete ALL(100%) images -> so I could start with fresh downloads.

(Background: the hardware had a memory bug. Perhaps that is the reason for having this error now. The hardware and disks are OK now.)

teecee
  • 33
  • 1
  • 5
  • it might be that your docker service has some other problems and the `/var/lib/docker` remains "dirty". I'd try the following: `service docker stop ; cd /var/lib; mv docker docker.old; mkdir docker ; service docker start` and then repull the image – Stefano Feb 13 '20 at 14:43
  • That will remove all 33 volumes as well. I would prefer to save them – teecee Feb 13 '20 at 15:43

2 Answers2

6

try to :

  • Stop docker service

  • Remove /var/lib/docker

  • Start docker service

Sariel
  • 158
  • 1
  • 11
  • OK. That could work for the images. There are 33 Volumes "local". I would loose all the data in these volumes? I am not sure what is in there. – teecee Feb 13 '20 at 15:30
  • 1
    I dont like that way very much. It sounds a little bit like Win95: if it stops working just re-install it. But I did it and it worked. – teecee Feb 14 '20 at 12:08
  • An explanation would help for what this answer does... but at least it works. – Olorin Jul 28 '21 at 14:31
  • It works, but just keep this in mind when removing the "/var/lib/docker" : https://stackoverflow.com/questions/46672001/is-it-safe-to-clean-docker-overlay2 :) – Polem Sep 02 '21 at 20:28
  • 1
    This is the only answer that worked for me after I had symlinked /var/lib/docker – Rahul Kadukar Jan 24 '22 at 19:16
0

For those who still depends on VirtualBox Docker Machine first SSH to VM:

docker-machine ssh
docker-machine ssh default
docker-machine ssh %NAME%

then stop service / delete Docker storage / start service inside the VM:

sudo /etc/init.d/docker stop
sudo rm -rf /var/lib/docker
sudo /etc/init.d/docker start

My Docker Machive was corrupted after no space left on device in Windows...

Note that following didn't help:

docker container prune
docker image prune --all --force
gavenkoa
  • 45,285
  • 19
  • 251
  • 303