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:

  • docker-compose not recognizing env_file file/location, and still tries to use the default .env
  • Ping docker containers on different hosts with ip addresses
  • docker tomcat directory not found?
  • Install package on Travis-ci with sudo:false [closed]
  • artifactory as docker registry
  • Docker: Do I need to rebuild the container from scratch whenever I need to add software?
  • <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 + Nodejs + Brunch + ReactJS image
  • Supervisord running flask app calling docker app
  • how to run nginx docker container with custom config?
  • Docker Rails Server Refusing Connections
  • Using private svn+bower doesn't work in dockerfile
  • Cross-compile using go build CGO_ENABLED - warning: libudev.so.1 not found
  • 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.