Last active
December 5, 2015 23:19
-
-
Save dmitrinesterenko/ba3c6491fdc7bcc9b6d2 to your computer and use it in GitHub Desktop.
Docker Kill Old Containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> docker ps -q # will print all existing containers in reverse chronological order. | |
# Pick one after which you want to remove all containers and use it in the next command. | |
385cebfa43b2 | |
af769cf18cef | |
2ba61ccb9327 | |
c082932195b3 | |
> docker rm $(docker ps -aq --before=c082932195b3) # where the before container ID is the container after which you want to delete the rest. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment