Docker如何更改存储库名称或重命名映像? [英] Docker how to change repository name or rename image?
本文介绍了Docker如何更改存储库名称或重命名映像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在改变图片的储存库名称:
I'm trying to change repository name of the image:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
server latest d583c3ac45fd 26 minutes ago 685.5 MB
因此,我想更改名称服务器
到类似 myname / server
:
Hence I want to change the name server
to something like myname/server
:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
myname/server latest d583c3ac45fd 26 minutes ago 685.5 MB
我该怎么做?
推荐答案
docker tag server:latest myname/server:latest
或
docker tag d583c3ac45fd myname/server:latest
标签只是人类可读的别名对于完整的图像名称( d583c3ac45fd。 ..
)。
Tags are just human-readable aliases for the full image name (d583c3ac45fd...
).
所以你可以有很多与你想要的相同的图像相关联。如果您不喜欢旧名称,则可以在您重新加注之后将其删除:
So you can have as many of them associated with the same image as you like. If you don't like the old name you can remove it after you've retagged it:
docker rmi server
只会删除别名/标签
。由于 d583c3ac45fd
有其他名称,实际的图像将不会被删除。
That will just remove the alias/tag
. Since d583c3ac45fd
has other names, the actual image won't be deleted.
这篇关于Docker如何更改存储库名称或重命名映像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文