2

I have simple Docker image built over ubuntu with dummy laravel php application. I use supervisord to start nginx and php-fpm. So far so good, everything works fine in my local machine or in any place where docker executable exists.

I'm trying to run same image in the Jelastic environment but I'm getting supervisord errors:

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)

I've contacted support and they told me that cron and php-fpm are already running because of systemd, so they logged in to my node, fixed something and now everything is running.

I'm wondering how this aligns with "Native Docker™© support"™ tagline everywhere in the documentation.

Anyways, I've setup new sample app for support investigation (image – https://hub.docker.com/r/rozhok/jelastic-laravel-docker/ sources – https://github.com/rozhok/jelastic-laravel-docker), tried to deploy it and everything worked fine all of sudden.

So my questions is:

  1. How to avoid supervisord and systemd clashes when deploying to Jelastic. Remember, I want to have same image for all my environments, and I don't want to prepare "special" images for Jelastic.

  2. Is there any other caveats we should know about? Maybe Docker support should be described a bit more.

Vova Rozhkov
  • 1,582
  • 2
  • 19
  • 27

1 Answers1

1

It seems that you need to add only one extra line to your Dockerfile: RUN systemctl disable php-fpm that will disable php-fpm from being spawned from your systemd process, your process will be definitely started by supervisor and that will make the image to be compatible for both Jelastic and your docker host running on your local machine.

Ihor Kolodyuk
  • 466
  • 2
  • 5