Mesos Marathon Docker Containers – CommandInfo

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:

  • Does a docker feature exist similar to save that only saves the new layer as a .tar?
  • Artifactory pro server behind an nginx frontend
  • How to remove a directory in docker?
  • WSO2 : how to download products in a Dockerfile?
  • Docker set up - cannot run hello-world
  • Docker exposed ports unreacheable
  • 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.

    enter image description here

    My question is:

    1. How do I set the CommandInfo Shell Option (either in Marathon or Mesos) to false? Where does that need to be set?

    When I run my ghost-blog-test image on the machine (using the standard docker run command), it uses / npm s as its default command. I would like the same behavior when using Mesos+Marathon.

    Thanks in advance!

  • Windows Docker Container Sizing and Scale planning
  • ADD command not working Docker
  • Cassandra docker - unable to connect through JMX
  • Cannot dump a database in a mysql container
  • Using jenkins docker image
  • CoreOS Fleet could not get container
  • 2 Solutions collect form web for “Mesos Marathon Docker Containers – CommandInfo”

    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).

    According to the API docs

    cmd (String)

    The command that is executed. This value is wrapped by Mesos via
    /bin/sh -c ${app.cmd}. Either cmd or args must be supplied. It is
    invalid to supply both cmd and args in the same app.

    args (Array of Strings)

    An array of strings that represents an alternative mode of specifying
    the command to run. This was motivated by safe usage of containerizer
    features like a custom Docker ENTRYPOINT. This args field may be used
    in place of cmd even when using the default command executor. This
    change mirrors API and semantics changes in the Mesos CommandInfo
    protobuf message starting with version 0.20.0. Either cmd or args must
    be supplied. It is invalid to supply both cmd and args in the same

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.