5

I have been using docker to run images along with some options like:

docker run --net host --oom-kill-disable -d -p <port>:<port> image

How do I set values like --oom-kill-disable on marathon?

t6nand
  • 710
  • 1
  • 8
  • 20

2 Answers2

6

It is required for docker containers in their marathon spec to specify a boolean value for oom-kill-disable flag for executor to run properly.

So the spec would include:

"parameters": [
            { "key": "oom-kill-disable", "value": "true" }
        ]
t6nand
  • 710
  • 1
  • 8
  • 20
  • 1
    Just FYI, the same can also be applied to `--init` parameter. In case someone is using the mesos java API, here is an example `Protos.ContainerInfo.DockerInfo.newBuilder().addParameters(Protos.Parameter.newBuilder().setKey("init").setValue("true"))` – Steven Jun 13 '19 at 04:54
2

I'm not quite sure if you can pass an empty value in this case, but you could go with something like this:

"container": {
    "type": "DOCKER",
    "docker": {
        "network": "HOST",
        "image": "your/image",
        "parameters": [
            { "key": "oom-kill-disable", "value": "" }
        ]
    }
}

You may read a little bit more here in "Privileged Mode and Arbitrary Docker Options" section.

serejja
  • 22,901
  • 6
  • 64
  • 72