HostOnNet Blog

Remove all docker containers

Looking for Linux Server Admin or WordPress Expert? We can help.

To remove all docker containers, run

docker rm -f $(docker ps -aq)

docker rm = remove container

-f = will stop container if running

docker ps -aq = List all containers.

-a list stopped containers.

-q only print container ID.

Delete all docker images

docker rmi -f $(docker images -q)

More Docker

Posted in Virtualization

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.