删除docker图像错误“没有这样的ID”与不同的图像ID

parallels@ubuntu:~$ sudo docker images [sudo] password for parallels: REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu 14.10 525b6e4a4cc8 6 days ago 194.4 MB <none> <none> 4faa69f72743 6 days ago 188.3 MB <none> <none> 78949b1e1cfd 3 weeks ago 194.4 MB <none> <none> 2d24f826cb16 3 weeks ago 188.3 MB <none> <none> 1f80e9ca2ac3 3 weeks ago 131.5 MB <none> <none> 5ba9dab47459 6 weeks ago 188.3 MB <none> <none> c5881f11ded9 9 months ago 172.2 MB <none> <none> 463ff6be4238 9 months ago 169.4 MB <none> <none> 195eb90b5349 9 months ago 184.7 MB <none> <none> 3db9c44f4520 10 months ago 183 MB parallels@ubuntu:~$ sudo docker rmi 4faa69f72743 Error response from daemon: No such id: 2103b00b3fdf1d26a86aded36ae73c1c425def0f779a6e69073b3b77377df348 2015/03/16 20:32:38 Error: failed to remove one or more images parallels@ubuntu:~$ 

在这里,你可以看到我试图删除4faa69f72743 。 然而,docker坚持,我试图删除2103b00... ,并出错,因为这样的形象不存在。

什么可能导致这个?

我不明白它的原因,但我find了一个解决scheme。

这里, docker ps -a显示带有与问题散列匹配的映像ID的退出容器。

 parallels@ubuntu:~$ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES parallels@ubuntu:~$ sudo docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1c538a69a522 2103b00b3fdf bash 3 hours ago Exited (-1) 3 hours ago sharp_mccarthy d9b683ddec73 2103b00b3fdf bash 3 hours ago Exited (0) 3 hours ago nostalgic_davinci fcf8f628066f 2103b00b3fdf bash 3 hours ago Exited (0) 3 hours ago drunk_rosalind 06591014c89a 2103b00b3fdf sleep 10 3 hours ago Exited (0) 3 hours ago sleepy_goldstine cb54fe012231 2103b00b3fdf sleep 10 3 hours ago Exited (0) 3 hours ago compassionate_leakey de9cc4cbefe5 2103b00b3fdf sleep 10 3 hours ago Exited (0) 3 hours ago agitated_brattain 0ac0e70451cd 2103b00b3fdf ps -a 3 hours ago Exited (1) 3 hours ago berserk_goldstine a6cc821ab7a4 2103b00b3fdf whoami 3 hours ago Exited (0) 3 hours ago distracted_pare 89f0c413787a ubuntu:14.10 whoami 3 hours ago Exited (0) 3 hours ago silly_hawking 5388489a2df2 ubuntu:14.10 whoami 3 hours ago Exited (0) 3 hours ago pensive_wozniak 1a060874271f ubuntu:14.10 pwd 3 hours ago Exited (0) 3 hours ago determined_goldstine 5bf4d049e3d2 ubuntu:14.10 pwd 3 hours ago Exited (0) 3 hours ago angry_hypatia 2033e10cb026 ubuntu:14.10 ls 3 hours ago Exited (0) 3 hours ago desperate_poincare 54f6f631cf17 ubuntu:14.10 ls 3 hours ago Exited (0) 3 hours ago cranky_davinci c44eb12aeedf ubuntu:14.10 bash 3 hours ago Exited (0) 3 hours ago high_darwin 64f14a9cf537 ubuntu:14.10 ps 3 hours ago Exited (0) 3 hours ago goofy_morse 4b8f2516ddbd ubuntu:14.10 whoami 3 hours ago Exited (0) 3 hours ago high_ardinghelli 0e3a3a6a8582 ubuntu:14.10 whoami 3 hours ago Exited (0) 3 hours ago dreamy_turing 49397f5bf47f ubuntu:14.10 ls 3 hours ago Exited (0) 3 hours ago grave_hoover 

试图删除图像是不成功的。

 parallels@ubuntu:~$ sudo docker rmi 2103b00b3fdf Error response from daemon: No such image: 2103b00b3fdf 2015/03/16 22:35:45 Error: failed to remove one or more images 

但是,我能够删除与图像关联的容器。

 parallels@ubuntu:~$ sudo docker rm 1c538 1c538 parallels@ubuntu:~$ sudo docker rm d9b fcf 065 cb5 de9 0ac a6c d9b fcf 065 cb5 de9 0ac a6c parallels@ubuntu:~$ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES parallels@ubuntu:~$ sudo docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 89f0c413787a ubuntu:14.10 whoami 3 hours ago Exited (0) 3 hours ago silly_hawking 5388489a2df2 ubuntu:14.10 whoami 3 hours ago Exited (0) 3 hours ago pensive_wozniak 1a060874271f ubuntu:14.10 pwd 3 hours ago Exited (0) 3 hours ago determined_goldstine 5bf4d049e3d2 ubuntu:14.10 pwd 3 hours ago Exited (0) 3 hours ago angry_hypatia 2033e10cb026 ubuntu:14.10 ls 3 hours ago Exited (0) 3 hours ago desperate_poincare 54f6f631cf17 ubuntu:14.10 ls 3 hours ago Exited (0) 3 hours ago cranky_davinci c44eb12aeedf ubuntu:14.10 bash 3 hours ago Exited (0) 3 hours ago high_darwin 64f14a9cf537 ubuntu:14.10 ps 3 hours ago Exited (0) 3 hours ago goofy_morse 4b8f2516ddbd ubuntu:14.10 whoami 3 hours ago Exited (0) 3 hours ago high_ardinghelli 0e3a3a6a8582 ubuntu:14.10 whoami 3 hours ago Exited (0) 3 hours ago dreamy_turing 49397f5bf47f ubuntu:14.10 ls 3 hours ago Exited (0) 3 hours ago grave_hoover 

最后,在移除容器后,我可以移除未使用的图像。

 parallels@ubuntu:~$ sudo docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu 14.10 525b6e4a4cc8 6 days ago 194.4 MB <none> <none> 4faa69f72743 6 days ago 188.3 MB <none> <none> 78949b1e1cfd 3 weeks ago 194.4 MB <none> <none> 2d24f826cb16 3 weeks ago 188.3 MB <none> <none> 1f80e9ca2ac3 3 weeks ago 131.5 MB <none> <none> 5ba9dab47459 6 weeks ago 188.3 MB <none> <none> c5881f11ded9 9 months ago 172.2 MB <none> <none> 463ff6be4238 9 months ago 169.4 MB <none> <none> 195eb90b5349 9 months ago 184.7 MB <none> <none> 3db9c44f4520 10 months ago 183 MB parallels@ubuntu:~$ sudo docker rmi 4faa Deleted: 4faa69f72743ce3a18508e840ff84598952fc05bd1de5fd54c6bc0f8ca835884 Deleted: 76b658ecb5644a4aca23b35de695803ad2e223da087d4f8015016021bd970169 Deleted: f0dde87450ec8236a64aebd3e8b499fe2772fca5e837ecbfa97bd8ae380c605e parallels@ubuntu:~$ 

万岁,无法解释的问题和解决scheme!