Reference link: https://www.youtube.com/watch?v=zs3tyVgiBQQ
- Build Docker Image
docker build -t test .
- Run container /w image
docker run -d --publish 8888:5000 test
- Login to ECR
aws ecr get-login-password --region <your-aws-region> | docker login --username AWS --password-stdin <your-account-id>.dkr.ecr.<your-region>.amazonaws.com
- Tag the version
docker tag test:latest <your-ecr-repo-uri>:<image-tag>
- Upload
docker push <your-ecr-repo-uri>:<image-tag>
//ECR
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "ecr:*",
"Resource": "*"
},
{
"Sid": "VisualEditor01",
"Effect": "Allow",
"Action": "ecr:GetAuthorizationToken",
"Resource": "*"
},
{
"Sid": "VisualEditor02",
"Effect": "Allow",
"Action": "ecr:InitiateLayerUpload",
"Resource": "*"
}
]
}
ECS
arn:aws:iam::aws:policy/AmazonECS_FullAccess