We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

ECR Repo

Now that we have a Docker image, let's host it on ECR!

Assignment

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.

  1. 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.

Tip

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 .