Sunday, February 12, 2017

Quick Docker environment cleanup

Just a quick reference on my docker usage.

When working / playing with docker a lot, you quite often end up with a ton of containers and volumes laying around after they are needed...

Here are a couple tips I use to keep my environment clean.

On Windows 10
If you are using GitBash create a .bashrc and include the commands below:

alias docker-rm='docker rm $(docker ps -q -f status=exited)'
alias docker-rmi='docker rmi $(docker images -q -f dangling=true)'
alias docker-rmv='docker volume rm $(docker volume ls -q -f dangling=true)'

For MacOS X 
Add the following to your .bash_profile:

docker rm $(docker ps -q -f status=exited)
docker volume rm $(docker volume ls -q -f dangling=true)
docker rmi $(docker images -q -f dangling=true)
docker-update-all() {
docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}'| xargs -L1 docker pull

Then simply run docker-rm, docker-rmi and docker-rmv to remove all the dangly bits :)

docker-update-all, is a handy way to get the latest images from docker hub.


  1. Apple's flagship operating system iOS 11 is nearing it's release. There will be quite a few changes from iOS 10 as well as some compatibility updates. You can check out my site to get all the details about iOS 11, the compatible devices
    iOS 11 beta

  2. Thank you for posting about these tips. Really appreciate how you have posted tips for both windows and MacOS. Do keep sharing more of these.

  3. Globalwebsolution was Created by Award-winning Designers who believed That Technology can empower anyone to be a Designer. We use artificial intelligence, premium design assets a delightful experience to provide professional-quality design instantly And 10x Cheaper.

  4. House fires are genuinely unfortunate and can scare encounters - you require experts to help with the recuperation and they will help sit down of your shoulders, and you can return to a typical way of life much sooner than you at any point thought conceivable.
    flood damage cleanup companies

  5. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.

  6. We deal with all the latest technological innovations and handy gadgets that you can use on a daily basis to ease your daily work routine

  7. This way is definitely great for using, maybe I'll go this way next. But I have windows os, and time to time, I receive messages, when I can not run the apps. I found out that it may appear if the d3dx9_43.dll is missing. Solution for this bug, which I choose, is completely easy. Eliminate this error is simple enough and does not take much time, just download the d3dx9_43.dll missing file to your computer and install it into correct folder. You can download this dll-library from website completely free of charge.

  8. I'm happy that I found this post, thanks so much!

  9. Wonderfull keep sharing Awesome post. Thank you for the valuable information.
    Learn More

  10. You have described all this well. That's what I meant, revelation!

  11. You made some decent points there. I looked on the internet for the issue and found most individuals will go along with with your website. download instagram videos

  12. I admire people who keep sharing valuable stories through great writing. I'm glad to have read this blog. Thanks and hope to read more soon. Check out Lawrence Todd Maxwell's to learn more about real estate.

  13. thanks for sharing this post .this post is really valuable .please keep updating.

  14. Thanks for your insight for your fantastic posting. I’m glad I have taken the time to see this. SEO Services

  15. Thanks for making me this Blog. You have done a great job by sharing this content here.
    Keep writing blog this like.

    Best Matlab Training in kanchipuram


Popular Posts