Cannot delete docker image

后端 未结 2 1728
面向向阳花
面向向阳花 2021-01-25 08:48

While setting up a new build machine (CentOS 7, Docker CE 17.12.0-ce), I did a simple test:

docker run -it --rm ubuntu bash

Which worked fine,

相关标签:
2条回答
  • 2021-01-25 09:23

    You could force-remove it

    docker rmi [IMAGE ID] -f or docker rmi [IMAGE ID] --force

    0 讨论(0)
  • 2021-01-25 09:25

    While setting up this system I had originally installed an old version of docker available from the standard CentOS repositories (yum install centos) instead of adding the docker repositories and installing docker-ce. Even though I'm on the latest version now, the old one must have introduced some bad data in /var/lib/docker before I upgraded. In the end I just deleted all the local image and container data and started over:

    sudo systemctl stop docker
    sudo rm -rf /var/lib/docker
    sudo systemctl start docker
    

    Everything is working normally now.

    0 讨论(0)
提交回复
热议问题