How to clean up unused Docker images

subject: Docker · date: 2017-12-07

  • To clean up dangling images:

    $ docker image prune
    
    WARNING! This will remove all dangling images.
    Are you sure you want to continue? [y/N] y
    
  • To remove all images which are not used by existing containers:

    $ docker image prune -a
    
    WARNING! This will remove all images without at least one container associated to them.
    Are you sure you want to continue? [y/N] y
    

read more

share this article