Closed mendrugory closed 8 years ago
I faced this problem because I was launching a docker container using the command option in order to add it a DNS. I have found a workaround in order to avoid this problem:
curl -XPOST 'http://my_marathon/v2/apps' -H 'Content-Type: application/json' -d '{ "id": "my_app", "container": { "docker": { "image": "my_app", "network": "BRIDGE", "parameters": [ { "key": "dns", "value": "DNS_IP" } ] }, "type": "DOCKER" }, "cpus": 1, "mem": 256, "instances": 4 }'
If the container is launched like that, it works like a charm.
Docker is natively supported using the container construct and should generally not be run through the "cmd" style.
Hi,
I am using Marathon to launch my docker containers through the rest API. I am using Mesos-DNS as service discovery and in order to let it know to the docker container I am launching the container using the command in order to be able to use the --dns option. (Is there any way of adding a DNS to a docker container using the container option of Marathon?)
curl -XPOST 'http://my_marathon:8080/v2/apps' -H 'Content-Type: application/json' -d '{ "id": "my_app", "cmd": "docker run --rm --dns DNS my_app", "cpus": 1, "mem": 256, "instances": 4 }'
When I try to stop the app using the Marathon UI, the 4 instances of my app are still running on the slaves although they don't appear in Marathon anymore.