Tutorial: Push your image to Amazon ECR
Now that you built and tested your Docker container, push it to an image repository. This example uses Amazon ECR, but you can use another registry, such as DockerHub.
-
Create an Amazon ECR image repository to store your container image. This example only uses the AWS CLI, but you can also use the AWS Management Console. For more information, see Creating a Repository in the Amazon Elastic Container Registry User Guide.
$
aws ecr create-repository --repository-name print-color
-
Tag your
print-color
image with your Amazon ECR repository URI that was returned from the previous step.$
docker tag print-color
aws_account_id
.dkr.ecr.region
.amazonaws.com/print-color -
Log in to your Amazon ECR registry. For more information, see Registry Authentication in the Amazon Elastic Container Registry User Guide.
$
aws ecr get-login-password \ --region
region
| docker login \ --username AWS \ --password-stdinaws_account_id
.dkr.ecr.region
.amazonaws.com -
Push your image to Amazon ECR.
$
docker push
aws_account_id
.dkr.ecr.region
.amazonaws.com/print-color