docker image 名称不小心写错了,例如想命名为 ubuntu1604-arm-qt,写成了 unbuntu1604-arm-qt。如何改回来?
用 docker tag 重命名
docker images 找到image_id
找到此 image id 是 efeb4214cfc4。
haojc@ubuntu:~/docker/ubuntu1604-arm-qt$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sword2000/unbuntu1604-arm-qt 1.0 efeb4214cfc4 13 hours ago 7.05GB
hello-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.0
Untagged: sword2000/unbuntu1604-arm-qt:1.0
haojc@ubuntu:~/docker/ubuntu1604-arm-qt$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sword2000/ubuntu1604-arm-qt 1.0 efeb4214cfc4 13 hours ago 7.05GB
hello-world latest fce289e99eb9 7 months ago 1.84kB