lifecycle-policy.json 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {
  2. "rules": [
  3. {
  4. "rulePriority": 1,
  5. "description": "Expire images that aren't tagged",
  6. "selection": {
  7. "tagStatus": "untagged",
  8. "countType": "imageCountMoreThan",
  9. "countNumber": 1
  10. },
  11. "action": {
  12. "type": "expire"
  13. }
  14. },
  15. {
  16. "rulePriority": 2,
  17. "description": "Keep last 3 images of branch images",
  18. "selection": {
  19. "tagStatus": "tagged",
  20. "tagPrefixList": ["branch-"],
  21. "countType": "imageCountMoreThan",
  22. "countNumber": 3
  23. },
  24. "action": {
  25. "type": "expire"
  26. }
  27. },
  28. {
  29. "rulePriority": 3,
  30. "description": "Keep last 3 images of commit images",
  31. "selection": {
  32. "tagStatus": "tagged",
  33. "tagPrefixList": ["commit-"],
  34. "countType": "imageCountMoreThan",
  35. "countNumber": 3
  36. },
  37. "action": {
  38. "type": "expire"
  39. }
  40. },
  41. {
  42. "rulePriority": 4,
  43. "description": "Remove any images older than 42 days",
  44. "selection": {
  45. "tagStatus": "any",
  46. "countType": "sinceImagePushed",
  47. "countUnit": "days",
  48. "countNumber": 42
  49. },
  50. "action": {
  51. "type": "expire"
  52. }
  53. }
  54. ]
  55. }