我有一个用虚拟laravel php应用程序在ubuntu上构建的简单Docker镜像。
我使用 super 用户来启动nginx和php-fpm。
到目前为止,一切都很好,在我的本地机器或docker可执行文件存在的任何地方,一切都正常。
我正在尝试在Jelastic环境中运行相同的镜像,但是却遇到了监督错误:
2017-01-21 14:34:30,283 INFO exited: cron (exit status 1; not expected)
2017-01-21 14:34:30,333 INFO exited: fpm (exit status 78; not expected)
2017-01-21 14:34:32,336 INFO spawned: 'cron' with pid 1216
2017-01-21 14:34:32,338 INFO spawned: 'fpm' with pid 1217
2017-01-21 14:34:32,341 INFO exited: cron (exit status 1; not expected)
2017-01-21 14:34:32,386 INFO exited: fpm (exit status 78; not expected)
我已经联系了支持人员,他们告诉我cron和php-fpm因为systemd已经在运行,所以他们登录到我的节点并修复了问题,现在一切都在运行。
我想知道这与文档中所有地方的“Native Docker™©support”™标语如何保持一致。
无论如何,我已经设置了用于支持调查的新示例应用程序(图像-https://hub.docker.com/r/rozhok/jelastic-laravel-docker/资源-https://github.com/rozhok/jelastic-laravel-docker),尝试部署它,一切突然之间一切正常。
所以我的问题是:
最佳答案
似乎您只需要在Dockerfile中添加一行即可:
RUN systemctl禁用php-fpm
这将禁止从您的systemd进程中生成php-fpm,您的进程肯定会由主管启动,这将使该镜像与Jelastic和本地计算机上运行的docker主机兼容。
关于docker - 如何在主管和Jelastic的监督下正确部署Docker容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41780717/