Sequel: Pushing to ECR Without Logging In (aws ecr get-login)
Overview
Last time I set things up so that I could push a Docker image to ECR without running the authentication command beforehand.
Pushing to ECR Without Logging In (aws ecr get-login)
However,
the setup is a bit of a hassle, which makes it inconvenient when you want to quickly write a one-liner in CircleCI, AWS CodeBuild, and the like.
Solution
By using a profile configured with awscli profile together with ecs-cli, authentication is handled for you.
1 | ecs-cli push <image> --aws-profile <profile> --region <region> |
Setup Steps
1 | aws configure set --profile hogehoge aws_access_key_id $ACCESS_KEY_ID |
1 | ecs-cli push 123456789012.dkr.ecr.ap-northeast-1.amazonaws.com/stg-mogemoge-rails:latest \ |
That’s it. Now you can push to ECR without using aws ecr get-login. ♪
