Unable to delete some untagged docker images

I am unable to explicitly delete some untagged docker images. Specifically, those with the tag <none>.

If I run docker images -a I get something like this:

  • Running Disco in a Docker container
  • Are docker images portable across different linux flavours?
  • How To Create And Start Docker Container node, detached mode using docker-java
  • Deployment of new version to containers
  • Start kdc in Dockerfile
  • creating jhipster-spring boot project war file error
  • <none>              <none>              91e54dfb1179        3 months ago        188.3 MB
    <none>              <none>              d74508fb6632        3 months ago        188.3 MB
    <none>              <none>              c22013c84729        3 months ago        188.3 MB
    <none>              <none>              d3a1f33e8a5a        3 months ago        188.1 MB
    <none>              <none>              4a5e6db8c069        3 months ago        125.1 MB
    <none>              <none>              2c49f83e0b13        3 months ago 
    

    However, when I type docker rmi -f 2c49f83e0b13 I get:

    Error response from daemon: Conflict, 2c49f83e0b13wasn't deleted
    Error: failed to remove images: [2c49f83e0b13]
    

    Any idea what could be the problem?

    These might be intermediary docker images for some images I’m actually using. But if that’s the case, then the completed docker images should already have those prior images and I don’t explicitly need those intermediary images to be there.

  • Understanding chroot
  • Issues with network traffic from docker
  • Docker-compose config front-end with back-end's IP from host's perspective
  • Can't install awscli to docker VM
  • dpkg: docker-ce: dependency problems, but removing anyway as you requested: nvidia-docker
  • Stop tomcat writing to stdout and stderror
  • 3 Solutions collect form web for “Unable to delete some untagged docker images”

    Make sure the image is actually dangling (meaning it is not referenced by any other image, or is not parent of an image)

    docker images --filter "dangling=true" -q --no-trunc
    

    If it is dangling (and should be removed), then there is a couple of pending bug reporting the impossibility to delete such images: issue 13625, issue 12487.

    The container should be stopped first before you can remove the image :

    docker rm $(docker ps -a -q)

    Source : https://github.com/docker/docker/pull/6112

    It happen to me also and restarting the docker engine and all the containers using this image solve the issue.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.