本文介绍了AWS Elastic Beanstalk Docker环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将环境变量传递给在AWS Elastic Beanstalk中运行的Docker容器多个Docker容器配置(不同的容器不同)?
How to pass environment variables to Docker containers running in AWS Elastic Beanstalk multiple docker container configuration(different for different containers)?
推荐答案
在容器说明中使用 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
For more information, see: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html
这篇关于AWS Elastic Beanstalk Docker环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!