do I need to manually tag “latest” when pushing to docker public repository?

▼魔方 西西 提交于 2020-05-09 20:07:12

问题


Suppose I have an image me/mystuff:v0.0.1

I find if I push it to the repository:

docker push me/mystuff:v0.0.1 

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

will result in a not found error for 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?

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)?


回答1:


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.



来源:https://stackoverflow.com/questions/27643017/do-i-need-to-manually-tag-latest-when-pushing-to-docker-public-repository

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!