Added command to removed unused data (#30665)

Added docker system prune command, which removes all unused data.
This commit is contained in:
Amit Poonia
2019-03-10 20:59:13 +05:30
committed by Christopher McCormack
parent ce03b5ccdc
commit 5babc47b2c

View File

@ -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`
`$ docker run it -v /folder_name:/data centos`