Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

--add-host parameter in Marathon docker application

I have docker images (with entrypoints) that I would like to run using Mesos and Marathon. These images require changes in /etc/hosts and /etc/resolv.conf. When I typically run this I would do something like:

docker run --add-host host:ip --dns-search url image

but in a marathon application (which i'm setting up as a json body to be sent to marathon), I have no idea what these options would be mapped to. For instance -p becomes portMappings in the json body. Does anybody know what the --add-host and --dns-search and potentially other options would become?

like image 599
Erik Nguyen Avatar asked Jul 15 '15 21:07

Erik Nguyen


Video Answer


1 Answers

You may pass them in parameters like that:

"container": {
    "type": "DOCKER",
    "docker": {
        "network": "HOST",
        "image": "your/image",
        "parameters": [
            { "key": "add-host", "value": "host:ip" },
            { "key": "dns-search", "value": "url" }
        ]
    }
}

Refer here, "Privileged Mode and Arbitrary Docker Options" section for details.

like image 136
serejja Avatar answered Oct 20 '22 03:10

serejja