Skip to content

Instantly share code, notes, and snippets.

@DoZator
Created April 18, 2019 08:51
Show Gist options
  • Save DoZator/cb15d472dc3a4e78be64ea6aa37c5d0e to your computer and use it in GitHub Desktop.
Save DoZator/cb15d472dc3a4e78be64ea6aa37c5d0e to your computer and use it in GitHub Desktop.
Using Amazon ECR

ECR Container Repository

Create repository

aws ecr create-repository --repository-name myproject/appname

Delete repository

aws ecr delete-repository --repository-name myproject/appname

List repositories

aws ecr describe-repositories

Login into the registry

aws ecr get-login --no-include-email --region <my-region>
docker login -u AWS -p ... https://aws-ecr-address

Push an image

Tag it with your ECR repository address:

docker tag my-app-image:latest aws-account-id.dkr.ecr.us-west-2.amazonaws.com/myproject/appname:latest

Push:

docker push aws-account-id.dkr.ecr.us-west-2.amazonaws.com/myproject/appname

List images

aws ecr list-images --repository-name myproject/appname
aws ecr batch-delete-image --repository-name myproject/appname --image-ids imageTag=latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment