Getting the latest image tag from ACR Repository

不羁岁月 提交于 2020-01-22 02:47:05

问题


I need to fetch the latest image tag from Azure Container Registry (ACR) with a bash command in my pipeline and use that tag for container deployment. Here is what I could find with Azure cli:

  $ az acr repository show-tags --name myacr --repository myrepo --top 1

However this returns me the oldest tag.

How can I get the latest pushed tag from ACR repo?


回答1:


See this doc: az acr repository show-tags and its parameters description:

Order the items in the results. Default to alphabetical order of names.

Based on your command, it is ordering by alphabetical order of names since you didn't specify the --orderby.

Add the parameter --orderby time_desc to make the result ordered by time.



来源:https://stackoverflow.com/questions/59322742/getting-the-latest-image-tag-from-acr-repository

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