在Docker中访问Elastic Beanstalk环境属性 [英] Accessing Elastic Beanstalk environment properties in Docker

查看:72
本文介绍了在Docker中访问Elastic Beanstalk环境属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我一直在寻找一个示例,该示例说明如何从AWS EB Web界面为Docker容器指定环境变量.通常,在EB中,您可以添加运行时可用的环境属性.在切换到Docker之前,我曾在之前的部署中使用过这些工具,但是看来Docker对于如何处理环境属性有一些不同的规则,对吗?根据本文[1],环境变量中将仅包含AWS凭证和PARAM1-PARAM5,但不会显示任何自定义属性.这对我来说听起来像是,特别是考虑到确实支持自定义环境属性的容器明确表示了这一点,例如此处显示的Python [2].有人对这种软件组合有任何经验吗?我需要指定的只是一个环境变量,该变量告诉我应用程序是处于暂存"还是生产"模式,然后由应用程序本身来设置我所有的特定于环境的配置.

So I've been looking around for an example of how I can specify environment variables for my Docker container from the AWS EB web interface. Typically in EB you can add environment properties which are available at runtime. I was using these for my previous deployment before I switched to Docker, but it appears as though Docker has some different rules with regards to how the environment properties are handled, is that correct? According to this article [1], ONLY the AWS credentials and PARAM1-PARAM5 will be present in the environment variables, but no custom properties will be present. That's what it sounds like to me, especially considering the containers that do support custom environment properties say it explicitly, like Python shown here [2]. Does anyone have any experience with this software combination? All I need to specify is a single environment variable that tells me whether the application is in "staging" or "production" mode, then all my environment specific configurations are set up by the application itself.

[1] http://docs.aws. amazon.com/elasticbeanstalk/latest/dg/command-options.html#command-options-docker

[2] http://docs.aws. amazon.com/elasticbeanstalk/latest/dg/command-options.html#command-options-python

推荐答案

AWS Elastic Beanstalk Docker容器支持自定义环境变量.看起来像文档中的小姐.您可以为您的环境定义自定义环境变量,并期望将它们传递给docker容器.

Custom environment variables are supported with the AWS Elastic Beanstalk Docker container. Looks like a miss in the documentation. You can define custom environment variables for your environment and expect that they will be passed along to the docker container.

这篇关于在Docker中访问Elastic Beanstalk环境属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆