Logging into ECR
Once you have created a repository for your Docker image, the next step is to build and publish your images to ECR. Before you can do this, you must authenticate with ECR, given at the time of writing ECR is a private service that does not support public access.
The instructions and commands for logging into ECR were displayed as part of the ECR repository wizard, however you can view these instructions any time by selecting an appropriate repository and clicking the View Push Commands button, which will display the various commands required to log in, build, and publish Docker images to the repository.
The first command displayed is the aws ecr get-login
command, which will generate a docker login
expression that includes temporary authentication token valid for logging into ECR for 12 hours (note the command output has been truncated in the interests of saving space):
> aws ecr get-login --no-include-email
docker login -u AWS -p eyJwYXl2ovSUVQUkJkbGJ5cjQ1YXJkcnNLV29ubVV6TTIxNTk3N1RYNklKdllvanZ1SFJaeUNBYk84NTJ2V2RaVzJUYlk9Iiw...