Update docker.md
This commit is contained in:
parent
c44a075f78
commit
8820f58f31
34
docker.md
34
docker.md
|
@ -123,45 +123,47 @@ docker rmi b750fe78269d
|
||||||
|
|
||||||
Deletes `image`s.
|
Deletes `image`s.
|
||||||
|
|
||||||
Clean up
|
## Clean up
|
||||||
------
|
|
||||||
|
### Clean all
|
||||||
|
|
||||||
### `clean All`
|
|
||||||
```sh
|
```sh
|
||||||
docker system prune
|
docker system prune
|
||||||
```
|
```
|
||||||
will clean up any resources — images, containers, volumes, and networks — that are dangling (not associated with a container)
|
|
||||||
|
Cleans up dangling images, containers, volumes, and networks (ie, not associated with a container)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker system prune -a
|
docker system prune -a
|
||||||
```
|
```
|
||||||
additionally remove any stopped containers and all unused images (not just dangling images)
|
|
||||||
|
|
||||||
### `docker containers`
|
Additionally remove any stopped containers and all unused images (not just dangling images)
|
||||||
|
|
||||||
|
### Containers
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
# Stop all running containers
|
||||||
docker stop $(docker ps -a -q)
|
docker stop $(docker ps -a -q)
|
||||||
|
|
||||||
|
# Delete stopped containers
|
||||||
|
docker container prune
|
||||||
```
|
```
|
||||||
|
|
||||||
stop all the running containers.
|
### Images
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker rm $(docker ps -a -q)
|
docker image prune [-a]
|
||||||
```
|
```
|
||||||
|
|
||||||
delete all the containers
|
Delete all the images
|
||||||
|
|
||||||
### `Images`
|
### Volumes
|
||||||
```sh
|
|
||||||
docker rmi $(docker images -a -q)
|
|
||||||
```
|
|
||||||
delte all the images
|
|
||||||
|
|
||||||
### `Volumes`
|
|
||||||
```sh
|
```sh
|
||||||
docker volume prune
|
docker volume prune
|
||||||
```
|
```
|
||||||
delete all the volumes
|
|
||||||
|
Delete all the volumes
|
||||||
|
|
||||||
Also see
|
Also see
|
||||||
--------
|
--------
|
||||||
|
|
Loading…
Reference in New Issue