How to delete docker images/containers

Source: Internet
Author: User
Tags docker ps

How to delete docker images/containers

Docker images often occupy hard disk space unconsciously. To clear redundant images, you can use the following methods:

1. Enter the root permission

Sudo su

2. Stop all container to delete the images:

Docker stop $ (docker ps-a-q)

Add a command to delete all container:

Docker rm $ (docker ps-a-q)

3. view the current images.

Docker images

4. delete images and use the image id to specify who to delete.

Docker rmi <image id>

You can use

Docker rmi $ (docker images | grep "^ <none>" | awk "{print $3 }")

To delete all images

Docker rmi $ (docker images-q)

 

Install Docker in CentOS 6/7 Series

Detailed explanation of the entire process of building Gitlab CI for Docker

Docker installation application (CentOS 6.5_x64)

What is the difference between Docker and a normal Virtual Machine?

Use MySQL in Docker

Docker will change everything

Docker installation application (CentOS 6.5_x64)

Docker details: click here
Docker: click here

This article permanently updates the link address:

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.