Skip to content

ECR

Created: 2018-10-19 10:57:09 -0700 Modified: 2019-06-09 20:39:10 -0700

ECR is the Elastic Container Registry. It’s for storing something like Docker images.

To use an image that’s stored in ECR, select a repository, click “View Push Commands” to get the login command, then simply do something like:

docker run -it 212785478310.dkr.ecr.us-west-2.amazonaws.com/botland/overseer:latest

Remember, this requires the environment variables to be set, which you can typically do by using —env-file .env.development

Setting up with Amazon ECR: https://docs.aws.amazon.com/AmazonECR/latest/userguide/get-set-up-for-amazon-ecr.html

Developer guide: https://docs.aws.amazon.com/AmazonECR/latest/userguide/ECR_GetStarted.html

Here are the steps that I went through for all of this from the beginning:

  • I already had an IAM, so I didn’t need to do anything there.
  • Install the newest AWS CLI (reference)
    • Install pip
    • $ pip install awscli —upgrade —user
    • Test to make sure it’s installed: $ aws —version
  • Go to ECR in the AWS console (i.e. the UI online)
  • ECR → Repositories → Get started
  • For “Repository name”, keep in mind that each semantic image is going to go into its own repository, so I came up with “botland/verdaccio”, “botland/overseer”, etc.
  • Click “next step”
  • Follow the instructions on the page, making sure to copy the ”$” in the first command.
  • AWS console → ECS → Repositories → Your repository → View Push Commands
  • Follow the steps in there
  • Typically, after doing this in production, you’d want to also update any related task definitions (if you didn’t just refer to the ":latest " one, in which case just update services as follows) and then any services based on those definitions.
    • [16:17] HiDeoo: aws ecs update-service —force-new-deployment —service serviceName

<Issues not found in this note> (e.g. “CannotPullContainerError”)

Section titled &lt;Issues not found in this note&gt; (e.g. “CannotPullContainerError”)

See the main ECS troubleshooting section