Command to stop or delete all Docker resources

As a memorandum, I often want to go straight when the environment is being built or verified.

Stop all Docker containers

$ docker stop $(docker ps -q)

Delete all Docker containers

$ docker rm $(docker ps -q -a)

Delete all Docker images

$ docker rmi $(docker images -q)

Delete all Docker volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

That's it.

Recommended Posts

Command to stop or delete all Docker resources
One liner to delete all Docker images
docker error delete command
Delete all Docker images
Grant docker command execution permission to ec2-user
Docker command
Try to use docker command without sudo.
Note: [Docker] How to start and stop
How to delete a controller etc. using a command
Memorandum docker command
Docker command list
Command when you want to erase all Docker images and containers cleanly and start over
Docker command memo
docker basic command
Docker command summary
Docker command memorandum
[Docker] Command summary
[Docker] Command list
Let's finally use Docker: Start, stop, delete development environment
Easy setup to run docker command without sudo (Linux)
Command to try using Docker for the time being