paint-brush
Three vital commands every Docker magician should knowby@KamilTamiola
3,740 reads
3,740 reads

Three vital commands every Docker magician should know

by Kamil TamiolaApril 21st, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The biggest pain of <a href="https://hackernoon.com/tagged/manual" target="_blank">manual</a> experimentation with <a href="http://docker.io/" target="_blank">Docker</a> builds is an overwhelming number of containers / images you can generate in a very short period of time. Nothing can replace a well designed and automated <a href="https://hackernoon.com/tagged/docker" target="_blank">Docker</a> build system. However, before you get there, I attach the commands, which I believe will save you a lot of time.

People Mentioned

Mention Thumbnail

Company Mentioned

Mention Thumbnail
featured image - Three vital commands every Docker magician should know
Kamil Tamiola HackerNoon profile picture

The biggest pain of manual experimentation with Docker builds is an overwhelming number of containers / images you can generate in a very short period of time. Nothing can replace a well designed and automated Docker build system. However, before you get there, I attach the commands, which I believe will save you a lot of time.

Please bare in mind, these commands should be only used on development systems, as they will irreversibly remove all your data.

Delete all containers:

docker rm $(docker ps -a -q)

Delete all images:

docker rmi $(docker images -q)

Force delete all images (even with linked containers):

docker rmi $(docker images -q) --force

Useful post? If so, make my day by clicking the heart below!

About the Author

Kamil Tamiola is the founder and the architect of Peptone — The Protein Intelligence Company. You can connect with him on AngelList, LinkedIn, Twitter, and Researchgate.