Amazon EC2 Container Registry

Fully Managed

Amazon EC2 Container Registry eliminates the need to operate and scale the infrastructure required to power your container registry. There is no software to install and manage or infrastructure to scale. Just push your container images to Amazon ECR and pull the images when you need to deploy.

Secure

Amazon EC2 Container Registry transfers your container images over HTTPS and automatically encrypts your images at rest. You can configure policies to manage permissions and control access to your images using AWS Identity and Access Management (IAM) users and roles without having to manage credentials directly on your EC2 instances.

Highly Available

Amazon EC2 Container Registry has a highly scalable, redundant, and durable architecture. Your container images are highly available and accessible, allowing you to reliably deploy new containers for your applications.

Simplified Workflow

Amazon EC2 Container Registry integrates with Amazon ECS and the Docker CLI, allowing you to simplify your development and production workflows. You can easily push your container images to Amazon ECR using the Docker CLI from your development machine, and Amazon ECS can pull them directly for production deployments.

Pricing

Aspect Monthly Price Monthly Cost
Storage $0.10 per GB-month $100 (1 TB)
Inbound Transfer free $0
Outbound < 1 GB free $0
Outbound < 1 TB $0.090 per GB $90
Outbound < 2 TB $0.090 per GB $180
Outbound < 10 TB $0.090 per GB $900
Outbound < 40 TB $0.085 per GB $3,400
Outbound < 100 TB $0.070 per GB $7,000
Outbound < 350 TB $0.050 per GB $17,500

* transfers with a region are free

Pricing Estimates

Service Limits

  • supports Docker Engine 1.7.0 and up
  • supports the Docker Registry V2 API specification
  • repository name limited to 256 characters
  • 1000 repositories per account
  • 500 images per repository
  • limits can be increased by contacting Amazon

Usage

  • https://711226717742.dkr.ecr.us-east-1.amazonaws.com
  • one IAM group for administrators
  • one IAM group for image producers (can push)
  • one IAM group for image consumers (can pull)
  • create IAM accounts and place them in the appropriate group
  • Bamboo would use the producer account and everybody else would use the consumer account

Authentication

# these are probably exported in ~/.bashrc and not hard coded in a script
export AWS_ACCESS_KEY_ID=AKIAINNZIWNCKQ4RRXZZ
export AWS_SECRET_ACCESS_KEY=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
export AWS_REGION=us-west-2

# authenticate our Docker client with Amazon (only lasts for 12 hours)
$(aws ecr get-login --region us-east-1)

docker login -u AWS -p CiBwm... -e none https://711226717742.dkr.ecr.us-east-1.amazonaws.com
  • the 12-hour window might be annoying
  • could just authenticate prior to each use
  • not sure how the Docker client reacts to large config files
  • maybe just clean/nuke the file periodically?

CLI

aws ecr help

ECR()                                                                    ECR()



NAME
       ecr -

DESCRIPTION
       Amazon EC2 Container Registry (Amazon ECR) is a managed AWS Docker reg-
       istry service. Customers can use the familiar Docker CLI to push, pull,
       and manage images. Amazon ECR provides a secure, scalable, and reliable
       registry.  Amazon  ECR  supports  private  Docker   repositories   with
       resource-based permissions using AWS IAM so that specific users or Ama-
       zon EC2 instances can access repositories and  images.  Developers  can
       use the Docker CLI to author and manage images.

AVAILABLE COMMANDS
       o batch-check-layer-availability

       o batch-delete-image

       o batch-get-image

       o complete-layer-upload

       o create-repository

       o delete-repository

       o delete-repository-policy

       o describe-repositories

       o get-authorization-token

       o get-download-url-for-layer

       o get-login

       o get-repository-policy

       o help

       o initiate-layer-upload

       o list-images

       o put-image

       o set-repository-policy

       o upload-layer-part

describe-repositories

aws ecr describe-repositories --region us-east-1
{
    "nextToken": "ukD72mdD/mC8b5xV3susmFe5EnPd5YIvSQl8QhQKid6/+fmYoHMI7rc/uFpQW9Yqz3Y1BEP14pcgGtUk9HVEqQTMjudE5MDYA/YjbN8TKzGY+DqVtjETEz+oWkeepLWuaZRTi3OygczQaZcBk4JhdA==",
    "repositories": [
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/aldt-courses-cards-cdc",
            "registryId": "711226717742",
            "repositoryName": "aldt-courses-cards-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tloregister-uistate-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tloregister-uistate-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-apigw",
            "registryId": "711226717742",
            "repositoryName": "al-apigw"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlotimetracker",
            "registryId": "711226717742",
            "repositoryName": "alat-tlotimetracker"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-entrypoint",
            "registryId": "711226717742",
            "repositoryName": "al-entrypoint"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlonodeamdin",
            "registryId": "711226717742",
            "repositoryName": "alat-tlonodeamdin"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolearningpath-apiroot-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolearningpath-apiroot-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tloregister-mli-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tloregister-mli-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/aldt-full-text-search",
            "registryId": "711226717742",
            "repositoryName": "aldt-full-text-search"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-auth",
            "registryId": "711226717742",
            "repositoryName": "al-auth"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlogomobile",
            "registryId": "711226717742",
            "repositoryName": "alat-tlogomobile"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlogroupcodes-users-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlogroupcodes-users-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tloresources",
            "registryId": "711226717742",
            "repositoryName": "alat-tloresources"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlogroupcodes-apiroot-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlogroupcodes-apiroot-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlouserprofile-users-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlouserprofile-users-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolistplayer-lists-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolistplayer-lists-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlomarklearned-lists-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlomarklearned-lists-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlosystemadmin-borr-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlosystemadmin-borr-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-nodes",
            "registryId": "711226717742",
            "repositoryName": "al-nodes"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlologin",
            "registryId": "711226717742",
            "repositoryName": "alat-tlologin"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser-lists-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser-lists-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolearningpath-systemconfig-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolearningpath-systemconfig-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolrapi-categories-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolrapi-categories-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlomli-apiroot-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlomli-apiroot-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlosystemadmin-nodes-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlosystemadmin-nodes-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolrapi-lists-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolrapi-lists-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlomarklearned-apiroot-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlomarklearned-apiroot-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlomarklearned-learningdata-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlomarklearned-learningdata-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser-full-text-search-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser-full-text-search-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tloregister-nodes-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tloregister-nodes-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-dockerbase",
            "registryId": "711226717742",
            "repositoryName": "al-dockerbase"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontainerjs-apiroot-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontainerjs-apiroot-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlomli",
            "registryId": "711226717742",
            "repositoryName": "alat-tlomli"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-mli",
            "registryId": "711226717742",
            "repositoryName": "al-mli"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser-systemconfig-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser-systemconfig-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontainerjs-nodes-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontainerjs-nodes-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlosystemadmin",
            "registryId": "711226717742",
            "repositoryName": "alat-tlosystemadmin"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-stubs",
            "registryId": "711226717742",
            "repositoryName": "al-stubs"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlonodeadmin",
            "registryId": "711226717742",
            "repositoryName": "alat-tlonodeadmin"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlosystemadmin-systemconfig-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlosystemadmin-systemconfig-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser-nodes-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser-nodes-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlogroupcodes",
            "registryId": "711226717742",
            "repositoryName": "alat-tlogroupcodes"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolearningpath-mli-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolearningpath-mli-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolearningpath-nodes-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolearningpath-nodes-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser-courses-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser-courses-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolearningpath-users-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolearningpath-users-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolearningpath-learningpath-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolearningpath-learningpath-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlounitplayer-courses-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlounitplayer-courses-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlouistate-uistate-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlouistate-uistate-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlologin-apiroot-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlologin-apiroot-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlonodeadmin-ui",
            "registryId": "711226717742",
            "repositoryName": "alat-tlonodeadmin-ui"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlomli-users-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlomli-users-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser-users-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser-users-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolrapi-learningpath-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolrapi-learningpath-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlounitplayer",
            "registryId": "711226717742",
            "repositoryName": "alat-tlounitplayer"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolistplayer-learningdata-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolistplayer-learningdata-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-mone",
            "registryId": "711226717742",
            "repositoryName": "al-mone"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tloregister-learningdata-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tloregister-learningdata-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tloregister-users-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tloregister-users-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/aldt-courses",
            "registryId": "711226717742",
            "repositoryName": "aldt-courses"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolistplayer-users-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolistplayer-users-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlounitplayer-learningdata-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlounitplayer-learningdata-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/aldt-cards",
            "registryId": "711226717742",
            "repositoryName": "aldt-cards"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-mone-build",
            "registryId": "711226717742",
            "repositoryName": "al-mone-build"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolrapi",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolrapi"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-tlocourses",
            "registryId": "711226717742",
            "repositoryName": "al-tlocourses"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolrapi-users-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolrapi-users-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/aldt-cache",
            "registryId": "711226717742",
            "repositoryName": "aldt-cache"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-tlo-ui-state",
            "registryId": "711226717742",
            "repositoryName": "al-tlo-ui-state"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser-learningdata-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser-learningdata-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/aldt-entrypoint",
            "registryId": "711226717742",
            "repositoryName": "aldt-entrypoint"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolanguages",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolanguages"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolrapi-apiroot-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolrapi-apiroot-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolearningpath",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolearningpath"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-integration-tests",
            "registryId": "711226717742",
            "repositoryName": "al-integration-tests"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolearningpath-lists-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolearningpath-lists-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlonodeadmin-languages-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlonodeadmin-languages-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolrapi-learningdata-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolrapi-learningdata-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser-resources-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser-resources-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tloalternativeanswers",
            "registryId": "711226717742",
            "repositoryName": "alat-tloalternativeanswers"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tloregister",
            "registryId": "711226717742",
            "repositoryName": "alat-tloregister"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlosystemadmin-languages-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlosystemadmin-languages-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlosystemadmin-ui",
            "registryId": "711226717742",
            "repositoryName": "alat-tlosystemadmin-ui"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-tlolist",
            "registryId": "711226717742",
            "repositoryName": "al-tlolist"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/al-mediatypes",
            "registryId": "711226717742",
            "repositoryName": "al-mediatypes"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/aldt-categories",
            "registryId": "711226717742",
            "repositoryName": "aldt-categories"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlosystemadmin-courses-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlosystemadmin-courses-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/aldt-apiroot",
            "registryId": "711226717742",
            "repositoryName": "aldt-apiroot"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlomli-cards-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlomli-cards-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlouserprofile",
            "registryId": "711226717742",
            "repositoryName": "alat-tlouserprofile"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontentbrowser-mli-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontentbrowser-mli-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlosystemadmin-apiroot-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlosystemadmin-apiroot-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontainerjs",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontainerjs"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlonodeadmin-users-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlonodeadmin-users-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlolearningpath-courses-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlolearningpath-courses-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlomarklearned",
            "registryId": "711226717742",
            "repositoryName": "alat-tlomarklearned"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlocontainerjs-languages-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlocontainerjs-languages-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/aldt-courses-apiroot-cdc",
            "registryId": "711226717742",
            "repositoryName": "aldt-courses-apiroot-cdc"
        },
        {
            "repositoryArn": "arn:aws:ecr:us-east-1:711226717742:repository/alat-tlologin-nodes-cdc",
            "registryId": "711226717742",
            "repositoryName": "alat-tlologin-nodes-cdc"
        }
    ]
}

list-images

aws ecr list-images --region us-east-1 --repository-name al-apigw
{
    "imageIds": [
        {
            "imageDigest": "sha256:592ef9f03585492bcc05a7776ebb1496ba606aff0dcc5edfdf3e2ea563e1761a",
            "imageTag": "latest"
        },
        {
            "imageDigest": "sha256:521aabce67716741991a930f04d067696f9e665fa62fb2e22dc3f80ad268aa21",
            "imageTag": "1.0.1-master"
        },
        {
            "imageDigest": "sha256:96b51f0dfa0ece22c5c645a241b85fac95b85b0251c87b551df56ed587b050d2",
            "imageTag": "master-1.0.5"
        },
        {
            "imageDigest": "sha256:e788f6fd1a3564ea7f0af4fcd0e90645048d2523e1a9030acc675133851efeb9",
            "imageTag": "master-1.0.2"
        },
        {
            "imageDigest": "sha256:c22f781bb0ef5c021ebad906791dd4ccd203775c021ae188f329cc9079ef4b5a",
            "imageTag": "master-1.0.6"
        },
        {
            "imageDigest": "sha256:c5163d32608135dabf81cb233b4be62ec96beb486a8dc8e18a4b277e618783f3",
            "imageTag": "master-1.0.1"
        },
        {
            "imageDigest": "sha256:b95112f833b3d3ce97492447791329a6e765df7477f9d2c0db74e2da9860d308",
            "imageTag": "master-1.0.3"
        },
        {
            "imageDigest": "sha256:81d3690a41f82204287b914ce9c668d7f7ec2b4b8b9e6e4901857f7ca36d5860",
            "imageTag": "master-1.0.4"
        },
        {
            "imageDigest": "sha256:f73354f679bac4fa8373f8ec97649103cc47e8a2890d93a2d6352cea06970766",
            "imageTag": "1.0.7-master"
        }
    ]
}

Docker In Docker

#!/bin/bash

CMD="docker run \
       --rm \
       --interactive \
       --tty \
       --volume /var/run/docker.sock:/var/run/docker.sock \
       --volume $(which docker):/bin/docker \
       --volume /usr/lib/x86_64-linux-gnu/libapparmor.so.1.1.0:/lib/x86_64-linux-gnu/libapparmor.so.1 \
       --entrypoint /bin/docker \
       ubuntu:14.04"

eval echo $CMD $*
eval $CMD $*
  • access Docker engine from within a container
  • might be able feed it the ECR credentials
  • or have it authenticate with AWS prior to each Docker call (I've tested this mechanism)

Docker In Docker

#!/bin/bash

TAG="docker tag --force $1 711226717742.dkr.ecr.us-east-1.amazonaws.com/$1"
echo eval $TAG
eval $TAG

$(aws ecr get-login --region us-east-1)
PUSH="docker push 711226717742.dkr.ecr.us-east-1.amazonaws.com/$1"
echo eval $PUSH
eval $PUSH
  1. tag the image
  2. authenticate with AWS
  3. push the image to AWS
  4. just needs the image and tag combination

Points To Consider

  • ECR is currently Virginia only
  • AL sandbox is in Oregon so we would pay for transit costs -- unless we moved AL
  • unclear what Amazon's multi-region support will ultimately be
  • use of IAM is very flexible and credentials can instantly be revoked if they ever escape
  • possible to name space the registry, eg al.registry... or tlo.registry... if we don't want to mix images

Amazon EC2 Container Registry

By Ronald Kurr

Amazon EC2 Container Registry

Amazon EC2 Container Registry

  • 1,407