add readme

This commit is contained in:
Jay 2019-03-07 17:31:14 +08:00
parent 77d234831e
commit 77eef3d5db

35
README.MD Normal file
View File

@ -0,0 +1,35 @@
# Golang Delete AWS ECR Image Tool
## Compile Code
``` bash
$ go get -v -u ./...
$ go build -o go-ecr-delete-image .
```
## Usage
```bash
$ ./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
```bash
# 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
```bash
# use aws configure
$ ./go-ecr-delete-image -profile default -e exclude1 -e exclude2 -repo repoName -keep 5
```