Install AWS CLI:
From the AWS console, create an ECR repo (private) for each app / GitHub repo on a region (us-east-1)
From the local machine, build each Docker image, tag them with AWS tags, then push to ECR (Push commands are available at console)
For example, t3a instances use amd64 CPU, while t4g ones use arm64 CPU.
Using amd64 images on a t4g.micro instance cause lower performance
Some AWS instance types use AWS’s own processor - Graviton: https://aws.amazon.com/ec2/graviton/
→ Better and cheaper instance types, but because it is ARM-based, so image platform must be considered
# Make sure AWS CLI is installed and authenticated, login docker to ECR
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <aws_id>.dkr.ecr.us-east-1.amazonaws.com
# Navigate to each app repo, build & tag the image, then push it to AWS
docker build -t mortredn/eks-demo-coffeeshop-frontend:latest .
docker tag mortredn/eks-demo-coffeeshop-frontend:latest <aws_id>.dkr.ecr.us-east-1.amazonaws.com/mortredn/eks-demo-coffeeshop-frontend:latest
docker push <aws_id>.dkr.ecr.us-east-1.amazonaws.com/mortredn/eks-demo-coffeeshop-frontend:latest
# Or building for multi-platform and pushing straight to AWS, use buildx
docker buildx build --platform linux/amd64,linux/arm64 -t <aws_id>.dkr.ecr.us-east-1.amazonaws.com/mortredn/eks-demo-coffeeshop-frontend:latest --provenance=false --push .