docker删除所有容器和镜像

news/2024/11/30 10:56:30/

确保自己有权限,一般先执行下面的命令获取管理员权限

sudo su

1、杀死运行的容器:

$ docker kill $(docker ps -a -q)

2、删除所有容器:

$ docker rm $(docker ps -a -q)

3、强制删除所有镜像:

$ docker rmi -f $(docker images -q)

一个示例:

today@today-virtual-machine:~/桌面/DCE/fixed/fix_dce$ sudo su
[sudo] today 的密码: 
root@today-virtual-machine:/home/today/桌面/DCE/fixed/fix_dce# docker kill $(docker ps -a -q)
Error response from daemon: Cannot kill container: 4ff41e8b6c5e: Container 4ff41e8b6c5e2eaed0e8cf5d9499bf7d8c8e872da6465e7bc72f80ea0a450dc7 is not running
Error response from daemon: Cannot kill container: e85e063b3849: Container e85e063b38494edc035b494313c7e7e6a78e6d71e63b83e61172381e5b26d07b is not running
Error response from daemon: Cannot kill container: 018e1213b3ce: Container 018e1213b3ce544c0e07c0e9f755b2e3b96c57007253027429d294c3f548983a is not running
Error response from daemon: Cannot kill container: 9291cf8ccc87: Container 9291cf8ccc877fca876bf155af9614548728ddd9fc102118e6a1e18520207e7b is not running
Error response from daemon: Cannot kill container: 01a9c2956f59: Container 01a9c2956f5995401c77162a8e549f1a2449ea82f0de2363b0043b3188429250 is not running
Error response from daemon: Cannot kill container: cbd6b4924b96: Container cbd6b4924b96592cb342df496631f7df6b2ce72d13c7ff4d5b7e94eb7f9cc9b9 is not running
Error response from daemon: Cannot kill container: 5d7d154bcdfa: Container 5d7d154bcdfa112aa41c276897e7a02324fd827d12faed3f352a81ad36f22ff2 is not running
Error response from daemon: Cannot kill container: ae13a3c6c07e: Container ae13a3c6c07e72b59ca76c361b12a8404244dbf2fe398c91f874604191cdb0e1 is not running
root@today-virtual-machine:/home/today/桌面/DCE/fixed/fix_dce# docker rm $(docker ps -a -q)
4ff41e8b6c5e
e85e063b3849
018e1213b3ce
9291cf8ccc87
01a9c2956f59
cbd6b4924b96
5d7d154bcdfa
ae13a3c6c07e
root@today-virtual-machine:/home/today/桌面/DCE/fixed/fix_dce# docker rmi -f $(docker images -q)
Untagged: deaddocker:latest
Deleted: sha256:30492eded37cb3106625ee50d40aa473efaf36750ac4663770fb3f8c37a22e87
Deleted: sha256:dd150ab76f8c8e2196a2542a7223d966d980749849bbb360f404c4aa113f77c6
Deleted: sha256:9bd9775c2124d955c24688373e9699c5d5a48db680b15606450e765a5a4f23aa
Deleted: sha256:e553bfaf32280ea1ede0c2365b5681b5729e4a80885a7594492627532b63d1ab
Deleted: sha256:23eb63b3874bd876d650458312a25d38b956a061c6fff431e8ff2798046f1d79
Deleted: sha256:04e6edf63666380d1b31ecd8872268f9078cb7f6cf6aa5535a3b5a0d5f282c11
Deleted: sha256:63e082819f0c42f3ba06cd717192f7101770d7527799c52ed3aaf1e89e81fe42
Deleted: sha256:cbbb3f5aba2c7319afb02cf95af488d08686c3998ee90bf52382ae4fce9f6014
Deleted: sha256:1894b4f51bd997492777eeb2b5b639618d880565962f0742d7c563893335df86
Deleted: sha256:40fe0e08efd8224e5f06c32a2f8089674e82f72eb9379bdecf1ad97af0ad424d
Deleted: sha256:a5768b68f4855125602911c0a3aa5f24ac95e99152808e0d847f2f9923e0f8d7
Deleted: sha256:4adb0f10386a02d26dc956e29d82117eb1e1e54ae32a09aa8cc53ac63b546d4e
Deleted: sha256:f603d3ff973d524028b52e01b5d2769759679c16f096086a621e49a41513fe2c
Deleted: sha256:2eb698a9f42a5a66987f4dc31d56979e74799f0602e67d3d6508b252f8696443
Deleted: sha256:32e6de3787b765d93ed0bfa928dc50b1179e27766b7f628b9a7335b8477ac592
Deleted: sha256:2bc0c2787b1c20f86da22a8316a2cd94f7154cd3d34791098090cfd67544a2ed
Deleted: sha256:a8031f73776c3323b1b5a05d16b7103c7c005bf302b5cb0b97adf7960fb2f086
Deleted: sha256:d2176c4d9bacf407acb7a4d251c8e9710c0fcd2692f9ae2bd00d16138e36edb4
Deleted: sha256:55a02bb403f702f549687d19d49edeac07f41e9953e5579ae4be2c6313a3512c
Deleted: sha256:dd60c0044241ac6cbadfc624a9ec8a119a9acbc081e73bd7f9fa3268065a7e40
Deleted: sha256:6069677e0d63bfd8595597bb95fdc23827da2d4540c7fdaf0da9c7bf133f8226
Deleted: sha256:b50f5f129f38bad2314fe1ff44e98186470058800eaec9258060b8c2d791d797
Deleted: sha256:483d8aa8def0819f47a5c0291effb251bed603538afad07a34a69634edde1136
Deleted: sha256:9509d4e47bc42342bf1c2095557727d068dc6c8843c4b5dc213f092cfe2f746a
Deleted: sha256:7a683a952f16ede9042f2325ca3c498f876da6ab1ed2be9c63da8d667427a8be
Deleted: sha256:53cebab8cb86970f12868bde78a446f77a76236d6ec12ccfebcd4bc6d67f2ec0
Deleted: sha256:96fb30fee6c260751b7e353ecf6438193cf21ffaa56e4aea8465080b10e874ef
Deleted: sha256:412e22785a0a9f8088d725f20d1ae269041e6c53b9cb5c1ed9bfa334abd079b6
Deleted: sha256:5215b623bcd9fb406adf1a0aa0d3d8ab800788fa0369eb1e19999f0ef6a0d45d
Deleted: sha256:6aa0b4206511720f072bf9d944a970e7ab5d1e6d8615cb506c98fa817952bb50
Deleted: sha256:75c4ad7a9a9723bf138a515689746dd7a2e61dfb4253e6db811c6bd144156a96
Deleted: sha256:a8e0520273dfc97bb54922694b7b118ea7420018fee5524f2c0d997a1d72446a
Untagged: archlinux:latest
Untagged: archlinux@sha256:51aa702faaa208a87d1a87d41fccbb844d75545f098973f27217e69ea6aea0a0
Deleted: sha256:aad4a3d7bd631d44ac076db639f84e589663eb0cf46ba1b9c5ba963b6057bae6
Deleted: sha256:f99e5d856e673bb4895113f0569d1534a7bf3bcdea56809443207fbbb104f7f2
Deleted: sha256:45d7473e9f4940063b4a2b326748df8e99aaed99560827b4e9cc6a978f20fc1c
root@today-virtual-machine:/home/today/桌面/DCE/fixed/fix_dce# docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE

http://www.ppmy.cn/news/445354.html

相关文章

钢管订购和运输

图与网络模型: 【1】图与网络模型及方法:图与网络的基本概念 【2】图&网络模型应用—最短路径问题 【3】树:基本概念与最小生成树 【4】匹配问题: 匈牙利算法 、最优指派、相等子图 【5】Euler 图和 Hamilton 图 【6】计…

Java:利用接口实现打印机案例(墨盒有彩色和黑白色,纸张有A4纸和B5纸)

把纸张和墨盒都定义为接口,让以后的实现类去实现它。 package com.jredu.oop.ch03; /*** 纸张接口* author Administrator**/ public interface Paper {/*** 纸张*/void paper();}package com.jredu.oop.ch03;public class A4Paper implements Paper{Overridepublic…

Kali和渗透测试

文章目录 Kali Linux使用U盘/移动硬盘以live方式启动Kali启动Kali和常见操作Kali工具集工具列表和分类aircrack-ngreaverettercap-graphicalwiresharknetdiscovernmapspartaike-scandmitryrecon-ngmaltegoniktounix-privesc-checkskipfishburpsuitesqlmap

套接字个人总结

建议看总结前先看个视频: C/C基础教程:详细讲解socket网络编程上_哔哩哔哩_bilibili 有上中下。 套接字函数总结: 初始化(了解即可): 类型:WORD //typedef unsig…

单价数量和总价的公式_知道总价和数量怎么算单价

本文收集整理关于知道总价和数量怎么算单价的相关议题,使用内容导航快速到达。 内容导航: Q1:总价=单价*数量 只改动总价和单价,数量不变,总价与单价是成正比例变化,也就是单价降到原来的45/56,就可以了。 Q2:wps表格中数量乘以单价怎么算总价? 比如数量是A2,单价是B2…

a5m2使用方法 mysql_反転

(2016-09-10 17:01) 新建1.reg Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag] ThisPCPolicy=Hide [HKEY_LOCAL_MACHINE\SOFTWARE\M…

纸的大小图解_常用纸张尺寸及示意图(A0,A1A3,A4,A5A8)数据源维基百科.PDF

常用纸张尺寸及示意图(A0,A1A3,A4,A5A8)数据源维基百科 mFP Charging-常用纸张尺寸说明 2011-12-09 v2.0 常用纸张尺寸及示意图(A0,A1...A3,A4,A5...A8) 数据源:维基百科 标准定义 ISO 216 定义了A 、B、C 三个系列的纸张尺寸。C 系列纸张尺寸主要使用于信封。 ISO 216 的格式…

无线网卡怎么连接台式电脑

无线网卡怎么连接台式电脑