May 2018
Intermediate to advanced
554 pages
13h 51m
English
Amazon ECR has an authentication mechanism to provide access to your private repositories. AWS CLI has a functionality to generate an access token using the aws ecr get-login command:
$ aws ecr get-login --no-include-email
It outputs the docker login command with the ID and password:
docker login -u AWS -p eyJwYXlsb2FkIjoiNy(very long strings)... https://************.dkr.ecr.us-east-1.amazonaws.com
Therefore, just copy and paste to your terminal to acquire a token from AWS. Then try docker push to upload your Docker image to ECR:
$ docker tag nginx ************.dkr.ecr.us-east-1.amazonaws.com/my-nginx$ docker push ************.dkr.ecr.us-east-1.amazonaws.com/my-nginxThe push refers to repository [************.dkr.ecr.us-east-1.amazonaws.com/my-nginx] ...