Get the App
SLTechnology News&Howtos  ›  Servers  › 

What does AWS ECR mean?

Shulou Source: shulou.com Published: 2022-05-31 16:17:38 10月04日 Update

This article mainly introduces what AWS ECR means. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

ECR is a private docker image repository.

Components of ECR: registry, authorization token, repository, repository policy, image.

Registry: each AWS account provides a registry of ECR. You can create a repository of images in the registry and store the images in the registry.

Authorization token: a token that the docker client pushes and pulls an image to the ECR registry for authentication.

Repository: where docker images are stored.

Repository policy: control access to the repository image through the repository policy.

Image: making a mirror of the container

How to push the image to the ECR repository:

1. First create an ECR image repository

Aws ecr create-repository-- name of the repository-name repository

two。 Tag the image

Docker tag image name aws_account_id.dkr.ecr.us-east-1.amazonaws.com/ repository name

3. Gets the authentication string for the registry; (the authorization token provided by this command is valid for 12 hours)

Aws ecr get-login-no-include-email

4. Push image to ECR

Docker push aws_account_id.dkr.ecr.us-east-1.amazonaws.com/ repository

5. Delete repository

Aws ecr delete-repository-- repository-name repository name-- force

The size of the compressed image is displayed on the AWS console, while the image seen with docker images is uncompressed.

You can see the information about the image on the page of the ecr repository in the console:

Image: information about images in the repository

Permissions: permission policy for the repository

Lifecycle Polic (Lifecycle Policy): lifecycle policy rules for repositories

Tags: the metadata label for the repository.

Operation of AWS CLI tag:

Mark the existing repository:

Aws ecr tag-resource-resource-arn arn:aws:ecr:region:account_id:repository:repository_name-tags Key=stack,Value=dev

Unmark:

Aws ecr untag-resource-resource-arn arn:aws:ecr:region:account_id:repository:repository_name-tag-keys tag_key

List the labels for the repository:

Aws ecr list-tags-for-resource-resource-arn arn:aws:ecr:region:account_id:repository:repository_name

Create the repository and apply the tags:

Aws ecr create-repository-repository-name test-repo-tags Key=team,Value=devs

The above is all the contents of this article "what does AWS ECR mean?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Store image mirror registry policy token name label control meaning information content cycle tag life article identity push authentication valid Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft Huawei NVidia OPPO Reno