My Personal Blog

Home

Building and Pushing Docker Image to ECR

May 21, 2024 | Categories: dev AWS Docker

Once the code is satisfactory and is ready to be deployed to AWS (e.g. for testing inside a Lambda function), run the following commands:
1. Build image: docker build --platform linux/amd64 -t image-name:latest .
2. Authenticate to ECR: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 11111222333.dkr.ecr.us-east-1.amazonaws.com
3. Tag image: docker tag image-name:latest 11111222333.dkr.ecr.us-east-1.amazonaws.com/image-name:latest
4. Push image: docker push 11111222333.dkr.ecr.us-east-1.amazonaws.com/image-name:latest

Leave a comment:

Comments: