Adam K Dean

Remove all Docker containers

Published on 5 June 2014 at 15:31 by Adam

After working with Docker for only a few hours, I now have more old containers than I have fingers.

A quick and easy way to remove these is to run:

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

-q is quiet mode, which only returns container IDs.

-a is all, which as it's name suggests, returns all containers.

This will try and remove any running containers too, but that will fail.



This post was first published on 5 June 2014 at 15:31. It was filed under archive with tags linux, docker.