AWS ECR Lifecycle Policy

以下的lifecycle policy 只保存ECR live和test的最新2个版本

{
  "rules": [
    {
      "rulePriority": 1,
      "description": "only save latest 2 version of live",
      "selection": {
        "tagStatus": "tagged",
        "tagPatternList": [
          "live*"
        ],
        "countType": "imageCountMoreThan",
        "countNumber": 2
      },
      "action": {
        "type": "expire"
      }
    },
    {
      "rulePriority": 2,
      "description": "only save latest 2 version of test",
      "selection": {
        "tagStatus": "tagged",
        "tagPatternList": [
          "test*"
        ],
        "countType": "imageCountMoreThan",
        "countNumber": 2
      },
      "action": {
        "type": "expire"
      }
    }
  ]
}

Loading

Facebook评论