Objective
Docker is a very interesting project. It claims to be able to ease the difficulty of deploying servers, and of course I believe there is hype in it. But after the actual use, I think the performance of Docker is commendable. This article mainly summarizes the Docker clear container mirror common commands, let's take a look together.
Kill all containers that running state
Docker kill $ (Docker ps-q)
Delete all containers that have stopped
Docker RM $ (Docker ps-a-Q)
Remove mirrors for all \ ' untagged/dangling\ ' () states
Docker RMI $ (Docker images-q-F Dangling=true)
Remove all mirrors:
Docker RMI $ (Docker images-q)
Create aliases for these commands:
# ~/.bash_aliases
# Kill all running containers.
Alias Dockerkillall=\ ' Docker kill $ (Docker ps-q) \ '
# Delete all stopped containers.
Alias dockercleanc=\ ' printf \ n>>> deleting stopped containersnn\ ' && Docker RM $ (Docker ps-a-Q) \ '
# Delete all untagged images.
Alias dockercleani=\ ' printf \ n>>> deleting untagged imagesnn\ ' && Docker RMI $ (Docker images-q-F Dangl ing=true) \ '
# Delete all stopped containers and untagged images.
Alias dockerclean=\ ' Dockercleanc | | True && dockercleani\ '
References: https://www.calazan.com/docker-cleanup-commands/
Summarize
The above is about Docker clear container mirroring command of all content, I hope the content of this article to everyone's study or work can bring certain help, if there is doubt you can message exchange, thank you for the cloud Habitat Community support.