简体   繁体   English

从 AWS ECR 存储库中获取特定标记的最新图像

[英]Fetch a particular tagged latest image from AWS ECR repo

Is it possible to fetch latest image from ECR with a particular docker tag which starts from develop like developXXX ?是否可以使用特定的 docker 标签从 ECR 中获取最新图像,该标签从像developXXX这样的 develop 开始? I am able to see latest image from a repo with this:我可以通过以下方式从回购中看到最新图像:

aws ecr describe-images --repository-name reponame --output text --region eu-west-1 --query 'sort_by(imageDetails,& imagePushedAt)[*].imageTags[*]' | tr '\t' '\n' | tail -1

Matching 'develop' keyword from all fetched image and returning the latest one with tail -1 .从所有获取的图像中匹配 'develop' 关键字并返回最新的带有tail -1的图像。

aws ecr describe-images --repository-name reponame --output text --region eu-west-1 --query 'sort_by(imageDetails,& imagePushedAt)[*].imageTags[*]' | grep -w "develop" | tail -1

You can change logic in grep -w "develop" part which can fit to your condition您可以在grep -w "develop"部分更改适合您条件的逻辑

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 docker 图像从一个 AWS ECR 存储库复制到另一个 - Copy docker image from one AWS ECR repo to another 在没有 AWS 凭据的情况下从 AWS ECR 存储库中提取图像 - Pulling image from AWS ECR repository without AWS credentials 在 ECS 集群中运行来自 AWS ECR 的公共镜像 - Running a public image from AWS ECR in ECS Cluster 如何将来自 AWS ECR 的私有镜像与 Airflow 的 DockerOperator 一起使用? - How to use a private image from AWS ECR with Airflow's DockerOperator? AWS Lambda from cross account ECR: Lambda 没有访问ECR镜像的权限 - AWS Lambda from cross account ECR : Lambda does not have permission to access the ECR image 无法使用 docker 和 VirtualBox 或 Colima 从 AWS ECR 存储库中提取图像 - Cannot pull image from AWS ECR repository using docker with VirtualBox or Colima AWS CDK - 如何有条件地创建 ECR 存储库 - AWS CDK - How do I create ECR repo conditionally 清单未知:无法从请求 \"/v2/$PROJECT_ID/$IMAGE:latest/manifests/latest\ ". - manifest unknown: Failed to fetch \"latest\" from request \"/v2/$PROJECT_ID/$IMAGE:latest/manifests/latest\ "." 如何使用 buildspec.yml 在 AWS CodePipeline 中从 Dockerfile 构建图像,然后推送到 ECR? - How to build Image from Dockerfile in AWS CodePipeline using buildspec.yml, and then push to ECR? 如何在启用 MFA 的情况下将 docker 图像从 AWS ECR 拉到 Minikube Kube.netes 集群 - How to pull a docker image from AWS ECR to Minikube Kubernetes cluster with MFA enabled
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM