You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jay 77eef3d5db add readme 2 years ago
vendor first version 3 years ago
.gitignore add ignore file 2 years ago
README.MD add readme 2 years ago
go.mod update modules 2 years ago
go.sum update modules 2 years ago
main.go fix keep image number 2 years ago

README.MD

Golang Delete AWS ECR Image Tool

Compile Code

$ go get -v -u ./...
$ go build -o go-ecr-delete-image .

Usage

$ ./go-ecr-delete-image -h 
Usage of ./go-ecr-delete-image:
  -e value
    	exlude delete tag
  -keep int
    	keep number images (default 5)
  -list-repo
    	list all repository
  -profile string
    	aws config profile
  -repo string
    	repository name

Example 1

# use env pass access_key and secret_key
$ AWS_ACCESS_KEY=key AWS_SECRET_KEY=key ./go-ecr-delete-image -e exclude1 -e exclude2 -repo repoName -keep 5

Example 2

# use aws configure
$ ./go-ecr-delete-image -profile default -e exclude1 -e exclude2 -repo repoName -keep 5