Docker remove none images

While you build docker images, it is many untagged images as <none> images. In my tutorial, Docker remove none images or How to stop all CONTAINER ID.

Docker remove none images

To display <none> images:

[huupv@docker nginx-reverse]$ sudo docker images | egrep "^<none>"

The output below:

<none> <none> 55c87cfec131 9 minutes ago 196.6 MB
<none> <none> 8bdd100ab20d 11 minutes ago 196.6 MB
<none> <none> bddbdbcfac80 55 minutes ago 396.5 MB
<none> <none> e8aa668e28d0 19 hours ago 396.5 MB

Docker remove all <none> images

[huupv@docker nginx-reverse]$ sudo docker images | egrep "^<none>" | awk '{print $3}' | xargs sudo docker rmi -f

How to stop all CONTAINER ID

To display all container ID

[huupv@docker ~]$ sudo docker ps | egrep -v "CONTAINER ID" | awk '{print $1}'

The output below:

24e65acc6d21
24da33d6e0d5
09488028a7a9
b3b5926dcb82

To stop all container ID

[huupv@docker ~]$ sudo docker ps | egrep -v "CONTAINER ID" | awk '{print $1}' | xargs sudo docker stop

Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology, especially Devops Skill such as Docker, vagrant, git, and so forth. I like open-sources, so I created DevopsRoles.com to share the knowledge I have acquired. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

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.