在 Cloud Formation Elastic Beanstalk 模板中指定 ECR 映像而不是 S3 文件
Specify ECR image instead of S3 file in Cloud Formation Elastic Beanstalk template
我想在我的 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 容器服务任务定义中可用的内容?
将 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.
我想在我的 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 容器服务任务定义中可用的内容?
将 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.