【问题标题】:How to rollback in Amazon ECS with Amazon ECR?如何使用 Amazon ECR 在 Amazon ECS 中回滚?
【发布时间】:2018-04-26 11:00:24
【问题描述】:

我坚持使用 Amazon ECR 作为 docker 注册表的 Amazon ECS 上的回滚策略。我想维护最新的 5 个映像版本(比如 latestv1 latestv2 latestv3 latestv4 latestv5 等),如果 latestv5 上的代码失败,我想回滚到 latestv4。

我尝试过使用 amazon ecr cli,它给了我所有未排序的标签。

aws ecr describe-images --repository-name api-gateway-demo --output json --query imageDetails[*].imageTags 

输出:

[
    [
        "latestv2"
    ], 
    [
        "latestv1"
    ], 
    [
        "latestv5"
    ], 
    [
        "latestv3"
    ], 
    [
        "latestv4" 
    ]
]

有任何想法来管理映像的版本控制以更好地在 ECR 上部署/回滚吗?

【问题讨论】:

    标签: amazon-web-services amazon-ecs


    【解决方案1】:

    根据我的经验,最好的方案是标记图像,以便您可以随时从您的注册表回滚或不私有。 https://docs.docker.com/engine/reference/commandline/tag/

    这也可能对您有所帮助 Is there a way to tag a previous layer in a docker image or revert a commit?

    【讨论】:

    • 是的,我只是通过图像版本控制来完成的。我必须编写一个脚本来管理图像的排序部分。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-11
    • 2018-05-20
    • 2020-01-06
    • 2023-04-11
    • 2017-09-13
    • 2019-11-13
    • 2023-03-25
    相关资源
    最近更新 更多