码迷,mamicode.com
首页 > 其他好文 > 详细

[转] docker rmi命令-删除image

时间:2018-05-11 12:45:23      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:命令   test   mes   BMI   int   let   osi   bsp   ret   

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

[转] docker rmi命令-删除image

标签:命令   test   mes   BMI   int   let   osi   bsp   ret   

原文地址:https://www.cnblogs.com/oxspirt/p/9023533.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!