为什么docker prune不能删除悬空的图像? [英] why does docker prune not remove my dangling images?

查看:212
本文介绍了为什么docker prune不能删除悬空的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

医生说docker prune删除了所有悬空的图像。甚至发出警告这将删除所有悬空的图像。那么为什么不删除我的呢?

Tthe docs say docker prune "removes all dangling images". And it even issues a warning "this will remove all dangling images". So why does it not remove mine?

 ubuntu@ip-172-31-26-48:~$ docker image prune
WARNING! This will remove all dangling images.
Are you sure you want to continue? [y/N] y
Total reclaimed space: 0 B
ubuntu@ip-172-31-26-48:~$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
simonm3/registrm    latest              bd3ef6d73785        7 minutes ago       468 MB
simonm3/registr     latest              7dd15943671b        2 hours ago         2.51 GB
simonm3/registrm    <none>              f8f22986e85a        45 hours ago        2.93 GB
simonm3/registrm    <none>              c1b9d8606371        45 hours ago        2.93 GB
simonm3/registrm    <none>              f1ca97467106        45 hours ago        2.93 GB
simonm3/registr     <none>              6a5af88f93a7        45 hours ago        4.42 GB
simonm3/registrm    <none>              93dc81b0fa7a        45 hours ago        2.93 GB
simonm3/registrm    <none>              dbc50510d499        45 hours ago        2.93 GB
simonm3/registr     <none>              0101ca5d4a25        45 hours ago        4.42 GB
simonm3/registrm    <none>              d8f85df39f0a        46 hours ago        2.93 GB
simonm3/registrm    <none>              053892e9798b        46 hours ago        2.93 GB
simonm3/registrm    <none>              3845056cf241        46 hours ago        2.92 GB
simonm3/registr     <none>              349ef3c589bd        46 hours ago        4.42 GB
simonm3/registrm    <none>              5dcbb0db4710        2 days ago          2.92 GB
simonm3/registr     <none>              e403f74861f6        2 days ago          4.32 GB
simonm3/registr     <none>              c12ca8819c24        5 days ago          4.32 GB
simonm3/registrm    <none>              4bb8ed8154b7        6 days ago          2.92 GB
ubuntu@ip-172-31-26-48:~$ docker images -q -f dangling=true
f8f22986e85a
c1b9d8606371
f1ca97467106
6a5af88f93a7
93dc81b0fa7a
dbc50510d499
0101ca5d4a25
d8f85df39f0a
053892e9798b
3845056cf241
349ef3c589bd
5dcbb0db4710
e403f74861f6
c12ca8819c24
4bb8ed8154b7


推荐答案

Docker将'修剪仍然有容器的悬空图像,即使它们不再运行也是如此。首先使用 docker container prune 删除已停止的容器,然后使用 docker image prune 删除修剪后的容器所依赖的悬空图像

Docker won't prune dangling images that still have containers, even if they're no longer running. Use docker container prune to remove stopped containers, first, then docker image prune will remove dangling images the pruned containers relied on.

这篇关于为什么docker prune不能删除悬空的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆