A tiny utility to simplify docker login process with AWS ECR.
Install using Go 1.6+ toolchain:
go install github.com/MOZGIII/aws-ecr-login/cmd/aws-ecr-login
All configuration comes from standard sources for AWS CLI and other tooling.
The most straightforward way is to set AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
and AWS_REGION
environment variables.
Just run aws-ecr-login
.
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_REGION=...
aws-ecr-login
It will print full docker login command to the standard output.
This app comes with a docker image: mozgiii/aws-ecr-login
.
Usage pattern is much the same: configure environment variables and run the command.
docker run --rm -it \
-e AWS_ACCESS_KEY_ID=... \
-e AWS_SECRET_ACCESS_KEY=... \
-e AWS_REGION=... \
mozgiii/aws-ecr-login