How to remove old Docker containers

To remove all Docker containers, you can use the command below which will delete all stopped containers:

docker container prune                                                                                     [docker remove all stopped containers]

If however you would like to remove all docker images (dangling and unreferenced), volumes, unused containers, run the command below:

docker system prune                                                                                          [docker remove all images]

The solution above is valid for Docker 1.13.x and above.

Read: How to create new users in a Docker container?

Answer due to Ken Cochrane

 

 


If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.

 

Nikolaus Oosterhof

Nikolaus has a degree in software development. He is passionate about gadgets with a screen, nostalgic for phones, a retired gamer and open source programmer. He likes also to write about macOS and Windows. design web pages and debug long programs!

Leave a Reply