From 9cfb8d30a7e0fc92dc60f4dad30efc7231b363dc Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 13 Nov 2020 19:11:18 +0000 Subject: README.md: added commands to delete all Docker images Until now we had described the basic commands on how to create and use Docker images, but we hadn't mentioned how you can delete them. With this commit the commands necessary for deleting Docker images have also been added at the bottom of the section on Docker. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index aadfcef..e9de293 100644 --- a/README.md +++ b/README.md @@ -414,6 +414,18 @@ command). docker cp CONTAINER:/file/path/within/container /host/path/target ``` +#### Deleting all Docker images + +After doing your tests/work, you may no longer need the multi-gigabyte +files images, so its best to just delete them. To do this, just run the two +commands below to first stop all running containers and then to delete all +the images: + +```shell +docker ps -a -q | xargs docker rm +docker images -a -q | xargs docker rmi -f +``` + -- cgit v1.2.1