Search code examples
tomcatdockermesosmesospheremarathon

docker mesosphere marathon - unable to see running process inside a docker container


I am a newbie in mesos and marathon space. I have mesos slaves running my docker containers. I am using marathon to instantiate a mesos task. Here is my simple json file:

{
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "tomcat:8.0"
    }
  },
  "id": "tomcat",
  "instances": 1,
  "cpus": 0.5,
  "mem": 512,
  "uris": [],
  "cmd": "while sleep 10; do date -u +%T; done"
}

I use curl and raise a post request using marathon. My docker container is deployed successfully as per marathon. Till here everything is fine. Now I ssh into my docker container using the command

sudo docker exec -i -t /bin/bash

I do not see any log generated for tomcat. I feel my tomcat has not started. Running telnet 8080 fails as telnet is not available on the container. when I run ps -aef I see th following is available "/bin/sh -c while sleep 10; do date -u +%T; done". However I cannot still say whether tomcat is running. Has anyone faced such issue...any pointers to debug it.

Thanks Ashish


Solution

  • In your JSON file you should have "cmd": "" (last line) otherwise the docker container command is overridden.