command module
v0.0.0-...-8ffcc23 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2019 License: MIT Imports: 5 Imported by: 0



Go Report Card license

The documented limit to the number of images in an ECR repository is ~1000~ (Now 10K as of Jul 19 2019). This is a golang implementation for removing unused images from your ECR repositories.

This script will inspect all container services/tasks, across all ECS clusters, removing images that are not in-use (in batches of 100).


go run main.go


  • -aws-region: Pass your AWS region.
  • -dry-run: Execute the script without purging any images.
go run main.go -aws-region us-west-2 -dry-run

Example Output

INFO[0005] Dry Run: true
INFO[0005] AWS Region: us-west-2
INFO[0005] Repositories Found: 3
INFO[0005] Active Images Found: 8
INFO[0005] ----------------------------------------------------------------
INFO[0005] Repository: my.production.repository
INFO[0005] [DRY RUN] `2` images would be purged
INFO[0005] ----------------------------------------------------------------
INFO[0005] Repository: my.staging.repository
INFO[0005] [DRY RUN] `2` images would be purged
INFO[0005] ----------------------------------------------------------------
INFO[0006] Repository: my.test.repository
INFO[0006] [DRY RUN] `1` images would be purged
INFO[0006] ----------------------------------------------------------------


If you've found a bug or would like to contribute, please create an issue here on GitHub, or better yet fork the project and submit a pull request!


The Go Gopher

There is no documentation for this package.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL