Elastic Container Registry (ECR)

Elastic Container Registry (ECR)

A basic version of Elastic Container Registry (ECR) is available to store application images. ECR is often used in combination with other APIs that deploy containerized apps, like ECS or EKS.

  1. $ awslocal ecr create-repository --repository-name repo1
  2. {
  3. "repository": {
  4. "repositoryArn": "arn:aws:ecr:us-east-1:000000000000:repository/repo1",
  5. "registryId": "abc898c8",
  6. "repositoryName": "repo1",
  7. "repositoryUri": "localhost:4510/repo1"
  8. }
  9. }

You can then build and tag a new Docker image, and push it to the repository URL (localhost:4510/repo1 in the example above):

  1. $ cat Dockerfile
  2. FROM nginx
  3. ENV foo=bar
  1. $ docker build -t localhost:4510/repo1 .
  2. ...
  3. Successfully built e2cfb3cf012d
  4. Successfully tagged localhost:4510/repo1:latest
  1. $ docker push localhost:4510/repo1
  2. The push refers to repository [localhost:4510/repo1]
  3. 318be7aea8fc: Pushed
  4. fe08d5d042ab: Pushed
  5. f2cb0ecef392: Pushed
  6. latest: digest: sha256:4dd893a43df24c8f779a5ab343b7ef172fb147c69ed5e1278d95b97fe0f584a5 size: 948
  7. ...

Last modified October 9, 2021: minor aws docs cleanup (01127291)