当前位置: 首页 > news >正文

docker停止所有容器和删除所有镜像

  1. 所有停止的容器
  2. 所有镜像文件(不论是否使用中)

✅ 一、删除所有 停止的容器

docker container prune -f

或者更底层方式:

docker rm $(docker ps -aq -f status=exited)

✅ 二、删除所有镜像文件(⚠️ 会把本地镜像全部清掉)

docker rmi -f $(docker images -aq)

✅ 三、组合命令:一键清理所有 停止容器 + 所有镜像

docker container prune -f && docker rmi -f $(docker images -aq)

🧹 可选:清理所有未使用资源(包括容器、镜像、网络、缓存)

docker system prune -a -f

这条命令会删除:

  • 停止的容器
  • 未被使用的所有镜像
  • 未用的网络
  • 构建缓存

⚠️ 请注意:这些操作是不可恢复的,确保你不需要那些容器和镜像再进行操作。


文章转载自:
http://apostrophic.pzdurr.cn
http://barrack.pzdurr.cn
http://caravaggesque.pzdurr.cn
http://actinozoan.pzdurr.cn
http://ballistics.pzdurr.cn
http://allocatee.pzdurr.cn
http://bestiary.pzdurr.cn
http://araroba.pzdurr.cn
http://affirmable.pzdurr.cn
http://centurial.pzdurr.cn
http://certified.pzdurr.cn
http://berley.pzdurr.cn
http://blouse.pzdurr.cn
http://bloom.pzdurr.cn
http://amalgamate.pzdurr.cn
http://carbonate.pzdurr.cn
http://calcite.pzdurr.cn
http://ampliation.pzdurr.cn
http://candlewood.pzdurr.cn
http://catacombs.pzdurr.cn
http://carrick.pzdurr.cn
http://blunderingly.pzdurr.cn
http://accomplishable.pzdurr.cn
http://argental.pzdurr.cn
http://britannic.pzdurr.cn
http://beerpull.pzdurr.cn
http://asthenopic.pzdurr.cn
http://berliozian.pzdurr.cn
http://ceasefire.pzdurr.cn
http://aganippe.pzdurr.cn
http://www.dtcms.com/a/280333.html

相关文章:

  • 从一道题目(阿里2014 Crackme_2)开启unidbg还原算法入门(转载)
  • 强化学习书籍
  • vscode 打开c++文件注释乱码
  • 分布式存储之Ceph使用指南--部署篇(未完待续)
  • Claude 背后金主亚马逊亲自下场,重磅发布 AI 编程工具 Kiro 现已开启免费试用
  • 【交叉编译报错】fatal: not a git repository (or any of the parent directories): .git
  • 分布式全局唯一ID生成:雪花算法 vs Redis Increment,怎么选?
  • 内存的基础相关知识,什么是内存,内存管理
  • 死锁问题以及读写锁和自旋锁介绍【Linux操作系统】
  • Spring 中 @Component和@Bean注解的区别
  • 为何说分布式 AI 推理已成为下一代计算方式
  • SpringBoot 2.x→3.0升级实战:Jakarta EE兼容性改造清单
  • kotlin布局交互
  • Kotlin聚合方法
  • Python 操作Excel工作表:添加、删除、移动、隐藏
  • 前端安全指南:防御XSS与CSRF攻击
  • 给 Excel 整列空格文字内容加上前缀:像给文字穿衣服一样简单!
  • Excel制作玫瑰图
  • PostgreSQL FATAL: sorry, too many clients already 连接数爆满的处理办法
  • excel 通过openpyxl表格下载和插入图片
  • 京东平台商品评论接口接入指南与代码实现
  • 国内大模型技术与应用综述
  • 区块链:以太坊侧链Polygon
  • 日常运维问题汇总-59
  • STL的一些知识点
  • C/C++宏定义中do{}while(0)的妙用
  • CAS单点登录架构详解
  • 弗兰肯斯坦式的人工智能与GTM策略的崩溃
  • (LeetCode 每日一题) 3136. 有效单词 (字符串)
  • 【牛客LeetCode数据结构】单链表的应用——移除链表元素问题、链表分割问题详解