0
votes

I'm trying to pass default parameters such as volumes or envs to my docker container, which I create through Marathon and Apache Mesos. It is possible through arguments passed to mesos-slave. I've put in /etc/mesos-slave/default_container_info file with JSON content (mesos-slave read this file and put it as its arguments):

{
  "type": "DOCKER",
  "volumes": [
    {
      "host_path": "/var/lib/mesos-test",
      "container_path": "/tmp",
      "mode": "RW"
    }
  ]
}

Then I've restarted mesos-slave and create new container in marathon, but I can not see mounted volume in my container. Where I could do mistake? How can I pass default values to my containers in other way?

1

1 Answers

0
votes

This will not work for you. When you schedule task on Marathon with docker, Marathon creates TaskInfo with ContainerInfo and that's why Mesos do not fill your default.

From the documentation

--default_container_info=VALUE JSON-formatted ContainerInfo that will be included into any ExecutorInfo that does not specify a ContainerInfo

You need to add volumes to every Marathon task you have or create RunSpecTaskProcessor that will augment all tasks with your volumes