docker刪除鏡像失敗

使用 docker rmi hello-world 命令刪除docker鏡像時提示:
Error response from daemon: conflict: unable to remove repository reference “xxxxxxx” (must force) - container xxxxxxxxxx is using its referenced image xxxxxxxxxxx
在這裏插入圖片描述

原因分析:
因爲有容器在使用將要刪除的鏡像,導致刪除失敗,這時需要先刪除對應的容器,再刪除鏡像即可。

docker rm 1f1dc26dcdf0        //刪除容器
docker rmi hello-world        //刪除鏡像

注意: 鏡像可能被多個容器佔用,需將所有佔用鏡像的容器刪除才行,看到下面紅框處的內容說明刪除鏡像成功。

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章