DEV Community

Cover image for Uploading Docker Images to AWS ECR
icncsx
icncsx

Posted on

Uploading Docker Images to AWS ECR

AWS

Create an ECR Repo

aws ecr create-repository --repository-name <name>
Enter fullscreen mode Exit fullscreen mode

Log-in to ECR

aws ecr get-login-password --region region | docker login --username AWS --password-stdin <registry_id>.dkr.ecr.<region>.amazonaws.com
Enter fullscreen mode Exit fullscreen mode

Tag your image

Tag your image with the Amazon ECR registry, repository, and optional image tag name combination to use. This is important if we want to push to ECR and not DockerHub.

docker tag <image_id> <registry_id>.dkr.ecr.region.amazonaws.com/<repo_name>:<tag>
Enter fullscreen mode Exit fullscreen mode

Upload image to ECR

docker push <registryId>.dkr.ecr.<region>.amazonaws.com/<repo>:<tag>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)