

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: VPC and Networking Setup
incomplete
2: Why ECS?
incomplete
3: Elastic Container Registry
incomplete
4: ECR Repo
incomplete
5: ECS Clusters
incomplete
6: ECS Permissions
incomplete
7: ECS Task Definitions
incomplete
8: ECS Security Groups
incomplete
9: Application Load Balancer
incomplete
10: Target Groups
incomplete
11: CloudWatch Log Groups
incomplete
12: ECS Services
incomplete
13: Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Now that we have a Docker image, let's host it on ECR!
Create an ECR repository patientping-ecs, and push the image.
Cost check: ECR storage costs about $0.10 per GB per month. For a small image like ours, which we'll keep on ECR only long enough for learning/testing, this is essentially free. Data transfer costs also apply when pulling images, but again, for learning purposes it's minimal.
docker buildx build \
--platform linux/amd64 \
--tag "YOUR-ACCT-ID.dkr.ecr.us-east-1.amazonaws.com/patientping-ecs:latest" \
--push .
Run and submit the CLI tests.
If you prefer the CLI:
aws ecr create-repository --repository-name patientping-ecs
my_account_id=$(aws sts get-caller-identity --query Account --output text)
my_region=$(aws configure get region)
aws ecr get-login-password --region "${my_region}" | docker login \
--username AWS \
--password-stdin "${my_account_id}.dkr.ecr.${my_region}.amazonaws.com"
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag "${my_account_id}.dkr.ecr.${my_region}.amazonaws.com/patientping-ecs:latest" \
--push .
# Fallback if multi-platform is unsupported on your Docker setup:
docker buildx build \
--platform linux/amd64 \
--tag "${my_account_id}.dkr.ecr.${my_region}.amazonaws.com/patientping-ecs:latest" \
--push .