一、查看鏡像 docker imagesdocker
rt@123:~# docker images REPOSITORY TAG IMAGE ID CREATED SIZE 192.168.0.1/jii/jenkins 1.0.1 3391ef1391f6 18 hours ago 206 MB 192.168.0.1/you/tom 1.0.8 f8ab12e03d53 22 hours ago 276 MB 192.168.0.1/you/tom 1.0.9 f8ab12e03d53 22 hours ago 276 MB
二、刪除鏡像,會報錯spa
rt@123:~# docker rmi f8ab12e03d53
Error response from daemon: conflict: unable to delete f8ab12e03d53 (must be forced) - image is referenced in multiple repositories3d
仔細觀察,發現f8ab12e03d53這個鏡像id指向了兩個repository,所以沒法刪除code
三、刪除時能夠用repository和tag的方式來刪除blog
rt@123:~# docker rmi 192.168.0.1/you/tom:1.0.8 Untagged:192.168.0.1/you/tom:1.0.8
四、再次查看鏡像,1.0.8的就被刪除了。ip
rt@123:~# docker images REPOSITORY TAG IMAGE ID CREATED SIZE 192.168.0.1/jii/jenkins 1.0.1 3391ef1391f6 18 hours ago 206 MB
192.168.0.1/you/tom 1.0.9 f8ab12e03d53 22 hours ago 276 MB