Docker Image 解決映象無法刪除的問題
阿新 • • 發佈:2022-04-28
Error response from daemon: conflict: unable to delete 4ac2d12f10cd (must be forced) - image is referenced in multiple repositories
來自守護程序的錯誤響應:衝突:無法刪除4ac2d12f10cd(必須強制) - 映像在多個儲存庫中被引用
1.刪除映象
檢視映象
root@souyunku:~/mydocker# docker images REPOSITORY TAG IMAGE ID CREATED SIZE nginx v1 4ac2d12f10cd 41 minutes ago 108MB souyunku/nginx v1 4ac2d12f10cd 41 minutes ago 108MB hello-world latest f2a91732366c 5 weeks ago 1.85kB
刪除失敗
刪除其中一個映象,這裡的映象有1個repo
引用,並且沒有容器使用
並且沒有容器使用
root@souyunku:~/mydocker# docker container ls -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4c104074b3f4 hello-world "/hello" About an hour ago Exited (0) About an hour ago priceless_hawking
映象有1個repo
引用
root@souyunku:~/mydocker# docker rmi 4ac
Error response from daemon: conflict: unable to delete 4ac2d12f10cd (must be forced) - image is referenced in multiple repositories
2.解決方法
刪除REPOSITORY
被刪除的ImageID
,這裡存在1個REPOSITORY
名字引用,解決方法如下:
即刪除時指定名稱,而不是IMAGE ID
。
root@souyunku:~/mydocker# docker rmi souyunku/nginx:v1 Untagged: souyunku/nginx:v1
再刪除IMAGE ID就可以了:
root@souyunku:~/mydocker# docker rmi 4ac
Untagged: nginx:v1
Deleted: sha256:4ac2d12f10cdb99c099749432b7a450ee1c6958e0f2f964cd64c6b086ba3e622
Deleted: sha256:346164f732e08d72d1f64828acda4e5ca93f79473f443ce57d9cfe69d9b66b24
Deleted: sha256:3f8a4339aadda5897b744682f5f774dc69991a81af8d715d37a616bb4c99edf5
Deleted: sha256:bb528503f6f01b70cd8de94372e1e3196fad3b28da2f69b105e95934263b0487
Deleted: sha256:410204d28a96d436e31842a740ad0c827f845d22e06f3b1ff19c3b22706c3ed4
Deleted: sha256:2ec5c0a4cb57c0af7c16ceda0b0a87a54f01f027ed33836a5669ca266cafe97a
3.檢視映象
root@souyunku:~/mydocker# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest f2a91732366c 5 weeks ago 1.85kB
Contact
- 作者:鵬磊
- 出處:http://www.ymq.io
- Email:[email protected]
- 版權歸作者所有,轉載請註明出處
- Wechat:關注公眾號,搜雲庫,專注於開發技術的研究與知識分享