Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-ecr: add page #6134

Merged
merged 17 commits into from
Jun 23, 2021
36 changes: 36 additions & 0 deletions pages/common/aws-ecr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# aws ecr

> Push, pull, and manage container images.
> More information: <https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ecr/index.html>.

- Authenticate Docker with your default registry (username is AWS):
258204 marked this conversation as resolved.
Show resolved Hide resolved

`aws ecr get-login-password --region {{region}} | {{docker login}} --username AWS --password-stdin {{aws_account_id}}.dkr.ecr.{{region}}.amazonaws.com`

- Create a repository:

`aws ecr create-repository --repository-name {{repo_name}} --image-scanning-configuration scanOnPush={{true|false}} --region {{region}}`
258204 marked this conversation as resolved.
Show resolved Hide resolved

- Tag a local image for ECR:

`docker tag {{container_name:latest}} {{aws_account_id}}.dkr.ecr.{{region}}.amazonaws.com/{{container_name:latest}}`
258204 marked this conversation as resolved.
Show resolved Hide resolved

- Push an image to a repository:

`docker push {{aws_account_id}}.dkr.ecr.{{region}}.amazonaws.com/{{container_name:latest}}`
258204 marked this conversation as resolved.
Show resolved Hide resolved

- Pull an image from a repository:

`docker pull {{aws_account_id}}.dkr.ecr.{{region}}.amazonaws.com/{{container_name:latest}}`
258204 marked this conversation as resolved.
Show resolved Hide resolved

- Delete an image from a repository:

`aws ecr batch-delete-image --repository-name {{repo_name}} --image-ids imageTag={{latest}}`
258204 marked this conversation as resolved.
Show resolved Hide resolved

- Delete a repository:

`aws ecr delete-repository --repository-name {{repo_name}} --force`
258204 marked this conversation as resolved.
Show resolved Hide resolved

- List images in a repository:
bl-ue marked this conversation as resolved.
Show resolved Hide resolved

`aws ecr list-images --repository-name {{repo_name}}`
258204 marked this conversation as resolved.
Show resolved Hide resolved