我尝试使用this package生成有效的Dockerrun.aws.json
文件。但是,我遇到了一些问题。
Dockerrun.aws.json
{
"containerDefinitions": [
{
"command": [
"./wait-for-it.sh",
"db:5432",
"--",
"./EXECUTABLE"
],
"essential": true,
"image": "gregpmillr/IMG",
"memory": 512,
"links": [
"db"
],
"name": "app",
"portMappings": [
{
"containerPort": 8080,
"hostPort": 443
}
]
},
{
"environment": [
{
"name": "POSTGRES_DB",
"value": "db"
},
{
"name": "POSTGRES_USER",
"value": "dbuser"
},
{
"name": "POSTGRES_PASSWORD",
"value": "dbpw"
}
],
"essential": true,
"image": "postgres",
"memory": 512,
"name": "db",
"portMappings": [
{
"containerPort": 5432,
"hostPort": 6000
}
]
}
],
"family": "",
"volumes": []
}
运行
eb deploy
后,出现错误:任何想法为什么这可能不正确?
最佳答案
用于多容器Docker设置的Elastic Beanstalk Dockerrun.aws.json
必须包括"AWSEBDockerrunVersion": 2
的键值对。
另外,我不认为Elastic Beanstalk支持"family"
或"containerDefinitions.command"
。看来您已经创建了task definition for Amazon ECS,该服务的配置和部署与Elastic Beanstalk不同。