Github Tags not updating

huangapple go评论66阅读模式
英文:

Github Tags not updating

问题

我正在为我的项目创建一个CI/CD流水线。我正在使用GitHub Actions构建镜像并将它们存储在AWS ECR中。

整个流水线运行正常,但在更新镜像标签时出现问题,每次运行流水线时,后续运行都会失败,提示镜像标签已存在于注册表中。

我尝试了多次,但没有成功。

我尝试从远程获取标签,但显示的是先前的版本,如下所示:
Github Tags not updating

当注册表中已经存在新的镜像标签时
Github Tags not updating

似乎最新的标签没有得到更新。

我正在使用一个bash脚本来在构建镜像时读取和更新标签。

请问有人可以解释如何自动更新标签吗?

英文:

I am creating a CI/CD Pipeline for my project. I am building the Images using GitHub Actions and storing them in the AWS ECR.

The whole pipeline works fine but there is a problem with updating the image tags, and whenever I run the pipeline the subsequent runs fail saying the Image Tag already exists in the registry.

I tried multiple times but had no luck.

I tried to fetch the tags from the remote, but it shows the previous version as below
Github Tags not updating

When there is already a new Image tag exists in the registry
Github Tags not updating

It seems like, the latest tag is not getting updated.

I am using a bash script to read and update the tag while building the image.

Can someone please explain how I can update the tags automatically?

答案1

得分: 1

更改ECR仓库设置为MUTABLE,以覆盖镜像标签。

参考链接:https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-tag-mutability.html

您可以配置仓库以打开标签不可变性,以防止镜像标签被覆盖。在仓库配置为不可变标签后,如果尝试推送带有仓库中已存在标签的镜像,将返回ImageTagAlreadyExistsException错误。

英文:

> whenever I run the pipeline the subsequent runs fail saying the Image Tag already exists in the registry.

Change ECR repo settings to MUTABLE to override image tag.

Reference: https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-tag-mutability.html

You can configure a repository to turn on tag immutability to prevent image tags from being overwritten. After the repository is configured for immutable tags, an ImageTagAlreadyExistsException error is returned if you attempt to push an image with a tag that is already in the repository.

huangapple
  • 本文由 发表于 2023年3月7日 20:06:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/75661772.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定