我需要手动标记“最新”标签吗?当推到docker公共存储库时? [英] do I need to manually tag "latest" when pushing to docker public repository?

查看:67
本文介绍了我需要手动标记“最新”标签吗?当推到docker公共存储库时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个图像 me / mystuff:v0.0.1

我发现是否将其推送到存储库:

I find if I push it to the repository:

docker push me/mystuff:v0.0.1 

latest 未创建,并且在从另一台计算机上拉出时会抱怨,例如

latest is not created, and on a pull from another machine it will complain, e.g.

ssh me@faraway
(faraway)  $ docker run -it me/mystuff /bin/bash

将导致未找到 me / mystuff:latest

我可以添加最新标签并将其显式推送到公共存储库:

I can add the latest tag and push explicitly to the public repository:

docker login me
docker tag me/mystuff:v0.0.1 me/mystuff:latest
docker push me/mystuff:latest

,然后从另一台计算机上

and then from another machine:

docker pull me/mystuff

因为最新的存在而起作用。

will work because latest exists.

我还发现,一旦存在最新版本,当推送新的编号版本时,它不会自动更新。

I am also finding that once latest exists, it does not auto update when a new numbered version is pushed.

我能以某种方式消除手动标记最新的步骤并拥有最新会自动指向最新的编号版本吗?

Can I somehow eliminate this step of manually tagging latest and have latest automatically point to the latest numbered version?

还是出于某种原因,例如允许将开发版本(仅标记为vN.N.N)与生产版本(标记为最新)分开?

Or is it there for a reason, like allowing the separation of development versions (tagged with a vN.N.N only) from the production version (tagged latest)?

推荐答案

如果未指定,则最新值只是标记的默认值。如果您推送标记的图像,它不会替换标记为最新的当前图像。

The latest is just the default value of the tag if none is specified. If you push a tagged image it does not replace the current image tagged with latest.

这篇关于我需要手动标记“最新”标签吗?当推到docker公共存储库时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆