【问题标题】:Specify ECR image instead of S3 file in Cloud Formation Elastic Beanstalk template在 Cloud Formation Elastic Beanstalk 模板中指定 ECR 图像而不是 S3 文件
【发布时间】:2017-02-14 14:26:31
【问题描述】:

我想在我的 Cloud Formation 模板的 Elastic Beanstalk 部分中引用一个 EC2 Container Registry 映像。示例文件引用了源包的 S3 存储桶:

"applicationVersion": {
  "Type": "AWS::ElasticBeanstalk::ApplicationVersion",
  "Properties": {
    "ApplicationName": { "Ref": "application" },
    "SourceBundle": {
      "S3Bucket": { "Fn::Join": [ "-", [ "elasticbeanstalk-samples", { "Ref": "AWS::Region" } ] ] },
      "S3Key": "php-sample.zip"
    }
  }
}

有什么方法可以引用 EC2 Container Registry 映像吗?类似于 EC2 容器服务 TaskDefinition 中可用的内容?

【问题讨论】:

    标签: amazon-cloudformation amazon-elastic-beanstalk amazon-ecs


    【解决方案1】:

    将 Dockerrun 文件上传到 S3 以执行此操作。这是一个 dockerrun 示例:

    {
      "AWSEBDockerrunVersion": "1",
      "Authentication": {
        "Bucket": "my-bucket",
        "Key": "mydockercfg"
      },
      "Image": {
        "Name": "quay.io/johndoe/private-image",
        "Update": "true"
      },
      "Ports": [
        {
          "ContainerPort": "8080:80"
        }
      ],
      "Volumes": [
        {
          "HostDirectory": "/var/app/mydb",
          "ContainerDirectory": "/etc/mysql"
        }
      ],
      "Logging": "/var/log/nginx"
    }
    

    将此文件用作 s3 密钥。更多信息可here.

    【讨论】:

      猜你喜欢
      • 2019-09-29
      • 2019-06-09
      • 2015-12-22
      • 2021-03-30
      • 2020-01-27
      • 2021-09-13
      • 2017-12-04
      • 1970-01-01
      • 2020-07-03
      相关资源
      最近更新 更多