Docker commonly used to clear container mirroring commands Summary _docker

Source: Internet
Author: User
Tags docker ps

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.