1

我想在我的Cloud Formation模板的Elastic Beanstalk部分中引用EC2容器註冊表圖像。示例文件引用源包的S3存儲桶:在Cloud Formation中指定ECR圖像而不是S3文件Elastic Beanstalk模板

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

是否有任何方法可以引用EC2容器註冊表映像?類似於EC2容器服務任務定義中的可用內容?

回答

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.

相關問題