An intermediate image is an image with the tag <none>:<none>, which means that they’re untagged images but they’re still tracked by Docker. They are created when the first image layer is downloaded/pulled during a docker pull. You can see them with the command: docker images -a

Some of these intermediate images are not used, which means they’re dangling images which eats up disk space in your docker host. Images might still exist even if the container is in exited state.

Use the following commands to prune/clean-up docker images and containers in your docker host:

  • Command to stop all running containers
    • docker stop $(docker ps -a -q)
  • Command to delete all containers
    • docker rm $(docker ps -a -q)
  • Command to specifically delete exited containers
    • docker rm ‘docker ps -aq –no-trunc –filter «status=exited»‘
  • Command to remove dangling images:
    • docker rmi ‘docker images –filter ‘dangling=true’ -q –no-trunc’
  • Command to delete all images
    • docker rmi $(docker images -q)
  • Starting with docker 1.13 (Sept 2016) you can use the command «docker system prune» which cleans the stopped containers, empty volumes and orphan images.

For more information check: http://www.projectatomic.io/blog/2015/07/what-are-docker-none-none-images/

Regards,
Javier Andrés Cáceres Alvis

Microsoft Most Valuable Professional – MVP

Intel Black Belt Software Developer