Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Docker batch deletes containers that have been stopped

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Environment: Docker version 19.03.5century centos7

The methods are as follows:

Under root users

(1) Delete all containers that are not running; those that run cannot be deleted.

Docker rm $(docker ps-a-Q)

(2) delete a container with a status of Exited according to the status of the container

Docker rm $(docker ps-qf status=exited)

(3) after docker version 1.13, you can use docker container prune to delete orphaned containers

Docker container prune

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report