将环境变量从docker传递给Supervisor
我通过docker run传递两个环境变量:将环境变量从docker传递给Supervisor,docker,supervisord,Docker,Supervisord,我通过docker run传递两个环境变量: docker run -d --name foobar -e STAGE=testing -e STAGE_URL=http://... 以及主管的dockerfile kicks,启动了两个流程: CMD ["/usr/bin/supervisord", "--configuration", "/etc/supervisor/conf.d/supervisord.conf"] 在supervisord.conf中,我尝试读取变量: [progr
docker run -d --name foobar -e STAGE=testing -e STAGE_URL=http://...
以及主管的dockerfile kicks,启动了两个流程:
CMD ["/usr/bin/supervisord", "--configuration", "/etc/supervisor/conf.d/supervisord.conf"]
在supervisord.conf
中,我尝试读取变量:
[program:build]
priority=1
autorestart=false
directory=/app/foobar
command=grunt build --force --stage ${STAGE} --stage-url ${STAGE_URL}
我也试过了
$STAGE
及
但阶段从来没有被视为变量。它永远不会被实际内容所取代。相反,它被视为一个简单的字符串。这导致:
--stage STAGE --stage-url STAGE_URL
而不是
--stage testing --stage-url http://...
这可能是我正在做的吗?主管文档对此主题不清楚。有什么想法吗?试试%(ENV_STAGE)s
问题似乎表明这是解决问题的方法。这里有可能的解决方案
--stage testing --stage-url http://...