Recently I setup Marathon, Mesos, and Docker across a few of my nodes. Everything is working well, except I'm encountering an issue when launching Docker containers. Specifically, when Marathon executes a task that launches a Docker container, marathon is appending /bin/sh -c ' '
as a default Docker command. This causes my containers to launch and then exit immediately (I can see that they launched by using docker ps -a
)
I took a look at the Mesos documentation, which states:
A docker image currently supports having an entrypoint and/or a default command.
To run a docker image with the default command (ie: docker run image), the CommandInfo’s value must not be set. If the value is set then it will override the default command.
To run a docker image with an entrypoint defined, the CommandInfo’s shell option must be set to false. If shell option is set to true the Docker Containerizer will run the user’s command wrapped with /bin/sh -c which will also become parameters to the image entrypoint.
This is good information (I'm seeing the expected behavior from Mesos), but I don't see an option in Marathon to turn off the CommandInfo shell.
My question is:
When I run my ghost-blog-test
image on the machine (using the standard docker run
command), it uses /entrypoint.sh npm s
as its default command. I would like the same behavior when using Mesos+Marathon.
Thanks in advance!
You need to define a command due to an issue (#2147) otherwise just not specifying a command should do the trick and run the default docker entrypoint.
The related bug is fixed in the newest (0.13) release but you need to use the API as there are still issues in the UI (#2749).