由于环境变量不存在,我的容器无法启动。
[Instance: i-036f3811889751cbe] Command failed on instance. Return code: 1 Output: (TRUNCATED)...cker container quit unexpectedly after launch: Docker container quit unexpectedly on Wed Jun 28 12:06:38 UTC 2017: nginx: [emerg] invalid number of arguments in "limit_except" directive in /etc/nginx/conf.d/default.conf:15. Check snapshot logs for details. Hook /opt/elasticbeanstalk/hooks/appdeploy/enact/00run.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
我无法设置环境变量,因为这会重新初始化以前的非成功应用程序。
我是否必须终止整个环境?
我正在尝试为尚未部署/初始化的新应用程序版本设置环境变量。
答案 0 :(得分:1)
我不记得我在哪里找到了解决方案,但基本上我通过将实例设置为0,设置环境变量,然后将实例设置为1来解决这个问题。
答案 1 :(得分:1)
我也在寻找答案,但是我找不到将实例设置为0的好方法。相反,我修改了我的应用程序以使其简单而不会中断。在我的情况下,只需修改Dockerfile即可运行Python http服务器(假设您的容器安装了Python):
ENTRYPOINT ["python", "-m", "http.server"]
这将允许容器在EB中运行。然后可以设置变量,然后将Dockerfile改回来。