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:

  • trouble with running e2e on bitbucket pipeline
  • how to retrieve volume from a removed Docker container?
  • Permission denied inside Docker container
  • “ps” command print error timestamp in container
  • How to apply kernel tuning on docker container
  • Redis regular timeouts on Docker
  • <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.

  • docker redis -Can't open the log file: No such file or directory
  • How to force application's stdout logs through uwsgi?
  • Publishing vNext project to Windows Server 2016 Preview Container
  • Add host mapping to /etc/hosts in Kubernetes
  • Ajax not responding on Node.Js Express server
  • Docker swarm nodes not showing up after restart
  • 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.