在不同帐户中的ECR之间复制容器图像的最佳实践

发布于 2025-01-22 11:36:40 字数 313 浏览 0 评论 0原文

我想知道在AWS中将Docker容器图像从ECR复制到ECR的最佳实践是什么。

我必须在多个ECR存储库之间定期复制容器图像,每个存储库都放在单独的AWS帐户中 - 例如镜像,但具有特定的滤镜,以复制什么和跳过。我编写了一个脚本,可以通过将遗漏的图像从“源” ECR提取到EC2 VM,然后将其推到“ Target” ECR。 这有效,但是我对在单个线程中执行此操作的性能并不满意,并且不是网络吞吐量限制它,而是“支出”以包装命令,对AWS进行一些必要的调用等。

因此,我正在考虑重写脚本到多线程应用程序,但我想知道我是否正在发明自行车,并且有一些已知的和更好的解决方案来解决此任务。

I wonder what are best practices for copying Docker container images from ECR to ECR in AWS.

I have to copy container images periodically between multiple ECR repositories, each placed in separate AWS account - like mirroring but with specific filters for what to copy and what to skip. I wrote a script that does this work by pulling missed images from the 'source' ECR to an EC2 VM, and pushes them to the 'target' ECR.
This works, but I am not satisfied by the performance of doing that in a single thread, and it's not network throughput limiting it but 'expences' to wrap commands, run some necessary calls to AWS, etc.

So I am thinking of rewriting the script to a multi-thread application, but I wonder if I'm inventing a bicycle, and there is some known and better solution for this task.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别念他 2025-01-29 11:36:40

正如AWS支持所证实的那样,除了直接镜像整个存储库以外,没有“开箱即用”的方法。

因此,我重写了以更聪明,更快的方式进行操作的工具,并发布了它。

https://github.com/github.com/dfad1ripe/aws-ecr-cross-cross-cross-acccount-克隆

要使用它,源和目标AWS帐户都应定义为〜/.aws/凭据中的配置文件,并且主机应运行Docker Engine或Docker Desktop。

As it was confirmed by AWS support, there was no 'out-of-the-box' way to do this job, other than direct mirroring of entire repository.

Thus I rewrote the tool for doing it in a smarter and faster way, and published it.

https://github.com/dfad1ripe/aws-ecr-cross-account-clone

To use it, both source and destination AWS accounts should be defined as profiles in ~/.aws/credentials, and the host should be running either Docker Engine or Docker Desktop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文