mirror of
https://github.com/wsargent/docker-cheat-sheet.git
synced 2025-09-22 05:40:50 +02:00
Add filter for stopped containers
and avoid "Error response from daemon: You cannot remove a running container. Stop the container before attempting removal or use -f"
This commit is contained in:
parent
36b631e289
commit
24557f37f6
1 changed files with 1 additions and 1 deletions
|
@ -392,7 +392,7 @@ docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs docker rm
|
||||||
### Delete stopped containers
|
### Delete stopped containers
|
||||||
|
|
||||||
```
|
```
|
||||||
docker rm `docker ps -a -q`
|
docker rm `docker ps -a -q -f status=exited`
|
||||||
```
|
```
|
||||||
|
|
||||||
### Delete dangling images
|
### Delete dangling images
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue