This tool helps you clean up your ECR repository. ECR is limited in how you can remove images by either a amount of elapsed time or via an expression matching the name. Due to the limitations in this combination this tool exists.
--days is set.--no-semver to remove SemVer tags. If the tag starts with a r or v those characters will be stripped and the remainder of the name will be tested for SemVer compatiability.--dry-run allows you to run the command to see what the results would be.--force to remove them anywaysUsing helm 3
$ helm repo add sstarcher https://shanestarcher.com/helm-charts/
$ helm install ecr-cleaner sstarcher/ecr-cleaner
If using kube2iam you will want to specify podAnnotations
podAnnotations:
iam.amazonaws.com/role: IAM_ROLE
By default dry-run is turned on and nothing will be deleted. Set the following to disable dry-run.
config:
dryRun: false
The following permissions will be needed by ecr-cleaner to function.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ecr-cleaner",
"Effect": "Allow",
"Action": [
"ecr:BatchDeleteImage",
"ecr:BatchGetImage",
"ecr:DescribeImages",
"ecr:ListImages",
"ecr:DescribeRepositories"
]
}
]
}
This is handled by docker hub's automated build process.
Content type
Image
Digest
Size
12.1 MB
Last updated
over 6 years ago
docker pull sstarcher/ecr-cleaner