WARNING: commands below delete stopped containers and remove all their data. Make sure you don’t have any containers or valuable data that you need to backup.
Remove exited containers
When a docker container exits, it leaves the stopped container on the system. Below command will remove that stopped container.
|
|
Remove dangling images
Docker keeps all of the images that you have used in the disk (local cache), even if those are not actively running. Below command will remove all those unwanted images.
|
|
All-in-one command
Execute below command if you want to delete and remove any stopped containers and unused images.
|
|