https://github.com/pete911/ecr-image-sync
sync public docker images to aws ecr
https://github.com/pete911/ecr-image-sync
aws-ecr aws-ecr-tools docker docker-sync
Last synced: 6 months ago
JSON representation
sync public docker images to aws ecr
- Host: GitHub
- URL: https://github.com/pete911/ecr-image-sync
- Owner: pete911
- License: mit
- Created: 2021-02-26T10:00:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T19:00:24.000Z (12 months ago)
- Last Synced: 2024-10-18T17:53:58.239Z (12 months ago)
- Topics: aws-ecr, aws-ecr-tools, docker, docker-sync
- Language: Go
- Homepage:
- Size: 7.53 MB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ecr-image-sync
[](https://github.com/pete911/ecr-image-sync/actions/workflows/pipeline.yml)
Downloads docker images from provided list, then tag with AWS ECR tags and uploads them to AWS ECR. This helps to keep
all images on AWS network (no need to download from public Internet), list can also be audited and reviewed.ECR repository has to exist before image sync is run.
## build and run
If required, project can be built (`make build`) and run (`./ecr-image-sync`) locally:
```
ecr-image-sync [flags]
```
```
+--------------+----------------------------------------------------------------+
| flags |
+--------------+----------------------------------------------------------------+
| -aws-account | AWS account where to sync images to |
+--------------+----------------------------------------------------------------+
| -aws-region | AWS region where to sync images to |
+--------------+----------------------------------------------------------------+
| -dry-run | whether to do sync - tag and push image |
+--------------+----------------------------------------------------------------+
| -images-file | file containing list of images to sync (default "images-list") |
+--------------+----------------------------------------------------------------+
| -version | ecr-image-sync version |
+--------------+----------------------------------------------------------------+
```## build
`go build` or `go install`
## download
- [binary](https://github.com/pete911/ecr-image-sync/releases)
## build/install
### brew
- add tap `brew tap pete911/tap`
- install `brew install pete911/tap/ecr-image-sync`### go
[go](https://golang.org/dl/) has to be installed.
- build `make build`
- install `make install`### docker
- run (dry-run) `docker run --rm -v $HOME/.aws/credentials:/root/.aws/credentials:ro -v $(pwd)/images-list:/images-list:ro pete911/ecr-image-sync:latest -aws-account -aws-region -dry-run`
- exec inside container (debug) `docker run -it --rm --entrypoint /bin/sh pete911/ecr-image-sync:latest`## release
Releases are published when the new tag is created e.g.
`git tag -m "add super cool feature" 0.1.0 && git push --follow-tags`