如何将 AWS CodePipeline 与 Elastic Container Registry 集成?

How do I integrate AWS CodePipeline with Elastic Container Registry?

我有一个构建过程,我想在其中执行以下操作

  1. 触发从 github 提取代码的 Jenkins 作业,构建 docker 容器并将其推送到 AWS ECR
  2. 运行 测试
  3. 拉出上述 docker 容器并将其部署到
  4. 上的弹性 beanstalk

第 3 步是我遇到最多麻烦的地方。我找不到任何关于如何将代码管道连接到 ECR,然后将多容器应用程序部署到 Elastic Beanstalk 的文档。我需要执行什么类型的操作才能连接到 ECR 并拉取容器进行部署?

拉取 docker 图像应该是您的 EB 部署包的一部分,以下是官方文档中的参考。另外,请参阅此 .

Multicontainer Docker Configuration

A Dockerrun.aws.json file is an Elastic Beanstalk–specific JSON file that describes how to deploy a set of Docker containers as an Elastic Beanstalk application

Using Images from an Amazon ECR Repository

Elastic Beanstalk automatically authenticates to the Amazon ECR registry with your environment's instance profile, so you don't need to generate an authentication file and upload it to Amazon Simple Storage Service (Amazon S3).