diff --git a/guide/english/containers/docker/useful-commands-for-docker/index.md b/guide/english/containers/docker/useful-commands-for-docker/index.md index 5d87f4014d..33682c01fc 100644 --- a/guide/english/containers/docker/useful-commands-for-docker/index.md +++ b/guide/english/containers/docker/useful-commands-for-docker/index.md @@ -87,6 +87,11 @@ $ docker stop $(docker ps -q) ### Remove containers while running (forcefully) `$ docker rm -f $(docker ps -a -q)` +### Remove all unused data +`$ docker system prune -a` + - This command will remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes. + - Note that in older Docker versions (below Docker 17.06.1) this command will also remove all those volumes which are not being used by any container. In newer Docker versions use the command `$ docker system prune -a --volumes` to remove unused volumes as well. + ### Giving docker OS a name when starting - By default, docker gives unique name to every container with a unique id. - We can also give a name to container using following command - @@ -128,4 +133,4 @@ Let the partition created is **mypart** This command will attach a RHEL to the container. ### Copy content from a folder of base system to _/data_ in docker centos -`$ docker run –it -v /folder_name:/data centos` \ No newline at end of file +`$ docker run –it -v /folder_name:/data centos`