← 返回命令列表

Linux command

aws-ecr 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Authenticate Docker

aws ecr get-login-password | docker login --username AWS --password-stdin [account-id].dkr.ecr.[region].amazonaws.com

Create a new repository

aws ecr create-repository --repository-name [my-repo]

List all repositories

aws ecr describe-repositories

List images

aws ecr list-images --repository-name [my-repo]

Describe image details

aws ecr describe-images --repository-name [my-repo] --image-ids imageTag=[latest]

Delete an image

aws ecr batch-delete-image --repository-name [my-repo] --image-ids imageTag=[v1.0]

Set a lifecycle policy

aws ecr put-lifecycle-policy --repository-name [my-repo] --lifecycle-policy-text file://[policy.json]

说明

aws ecr is the AWS CLI interface for Amazon Elastic Container Registry (ECR), a fully managed Docker container registry. ECR makes it easy to store, manage, and deploy Docker container images with integration into Amazon ECS and EKS. ECR provides private repositories with IAM-based access control, automatic image scanning for vulnerabilities, cross-region and cross-account replication, and lifecycle policies for image retention management.

FAQ

What is the aws-ecr command used for?

aws ecr is the AWS CLI interface for Amazon Elastic Container Registry (ECR), a fully managed Docker container registry. ECR makes it easy to store, manage, and deploy Docker container images with integration into Amazon ECS and EKS. ECR provides private repositories with IAM-based access control, automatic image scanning for vulnerabilities, cross-region and cross-account replication, and lifecycle policies for image retention management.

How do I run a basic aws-ecr example?

Run `aws ecr get-login-password | docker login --username AWS --password-stdin [account-id].dkr.ecr.[region].amazonaws.com` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more aws-ecr examples?

This page includes 7 examples for aws-ecr, plus related commands for nearby Linux tasks.