[转] docker rmi命令-删除image

rmi 删除image

Usage: docker rmi IMAGE [IMAGE...]Remove one or more images -f,--force=falseForce removal of the image --no-prune=falseDonotdelete untagged parents

Removing tagged images

Images can be removed either by their short or long ID`s, or their image names. If an image has more than one name, each of them needs to be removed before the image is removed.

$ sudo docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
test1                     latest              fd484f19954f        23 seconds ago      7 B (virtual4.964 MB) test latest fd484f19954f 23 seconds ago 7 B (virtual4.964 MB) test2 latest fd484f19954f 23 seconds ago 7 B (virtual4.964 MB) $ sudo docker rmi fd484f19954f(指定通过id来删除就会有问题,一个id可能被多个名字引用!) Error:Conflict, cannot delete image fd484f19954f because it is tagged in multiple repositories 2013/12/1105:47:16Error: failed to remove one or more images $ sudo docker rmi test1(指定image的名字删除,就可以) Untagged: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8 $ sudo docker rmi test2 Untagged: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8 $ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE test latest fd484f19954f 23 seconds ago 7 B (virtual4.964 MB) $ sudo docker rmi test Untagged: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8 Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8

转载于:https://www.cnblogs.com/oxspirt/p/9023533.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值