英文:
Github Tags not updating
问题
我正在为我的项目创建一个CI/CD流水线。我正在使用GitHub Actions构建镜像并将它们存储在AWS ECR中。
整个流水线运行正常,但在更新镜像标签时出现问题,每次运行流水线时,后续运行都会失败,提示镜像标签已存在于注册表中。
我尝试了多次,但没有成功。
似乎最新的标签没有得到更新。
我正在使用一个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
When there is already a new Image tag exists in the registry
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论