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-colorimage with your Amazon ECR repository URI that was returned from the previous step.$docker tag print-coloraws_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 \ --regionregion| docker login \ --username AWS \ --password-stdinaws_account_id.dkr.ecr.region.amazonaws.com -
Push your image to Amazon ECR.
$docker pushaws_account_id.dkr.ecr.region.amazonaws.com/print-color