Docker重命名鏡像名稱和TAG操作
使用docker images時,可能會出現REPOSITORY和TAG均為none的鏡像,如下圖
這時,我們可以重命名鏡像
# docker tag IMAGEID(鏡像id) REPOSITORY:TAG(倉庫:標簽)
補充知識:docker image 重命名
docker image 名稱不小心寫錯了,例如想命名為 ubuntu1604-arm-qt,寫成了 unbuntu1604-arm-qt。如何改回來?
用 docker tag 重命名
docker images 找到image_id
找到此 image id 是 efeb4214cfc4。
haojc@ubuntu:~/docker/ubuntu1604-arm-qt$ docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEsword2000/unbuntu1604-arm-qt 1.0 efeb4214cfc4 13 hours ago 7.05GBhello-world latest fce289e99eb9 7 months ago 1.84kB
用docker tag <image_id> 重新命名
docker tag efeb4214cfc4 ubuntu1604-arm-qt
然后將原來的image名稱刪除
docker rmi sword2000/unbuntu1604-arm-qt:1.0
haojc@ubuntu:~/docker/ubuntu1604-arm-qt$ docker rmi sword2000/unbuntu1604-arm-qt:1.0Untagged: sword2000/unbuntu1604-arm-qt:1.0haojc@ubuntu:~/docker/ubuntu1604-arm-qt$ docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEsword2000/ubuntu1604-arm-qt 1.0 efeb4214cfc4 13 hours ago 7.05GBhello-world latest fce289e99eb9 7 months ago 1.84kB
以上這篇Docker重命名鏡像名稱和TAG操作就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持好吧啦網。
相關文章:
1. php測試程序運行速度和頁面執行速度的代碼2. ASP中常用的22個FSO文件操作函數整理3. 三個不常見的 HTML5 實用新特性簡介4. Warning: require(): open_basedir restriction in effect,目錄配置open_basedir報錯問題分析5. ASP調用WebService轉化成JSON數據,附json.min.asp6. SharePoint Server 2019新特性介紹7. React+umi+typeScript創建項目的過程8. 無線標記語言(WML)基礎之WMLScript 基礎第1/2頁9. ASP.NET Core 5.0中的Host.CreateDefaultBuilder執行過程解析10. php網絡安全中命令執行漏洞的產生及本質探究
