如何将环境变量传递给在AWS Elastic Beanstalk中运行的Docker容器多个docker容器配置(不同的容器不同)?
最佳答案
在容器描述中使用environment
键。
{
"containerDefinitions": [
{
"name": "myContainer",
"image": "something",
"environment": [
{
"name": "MY_DB_PASSWORD",
"value": "password"
}
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
],
"memory": 500,
"cpu": 10
}]
}
有关更多信息,请参见:http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html
关于amazon-web-services - AWS Elastic Beanstalk Docker环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30413307/