0

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

ashishjain
  • 1,243
  • 1
  • 11
  • 12
  • I believe you have to use port mapping on your JSON file so that you can run the Tomcat server? You can also try netstat -an | grep 8080. – Hans Feb 10 '15 at 03:20
  • docker exec does not use SSH to enter a container. It uses kernel namespaces to start a new process inside a container, in this case a new shell. – Markus Rexhepi-Lindberg Oct 20 '15 at 09:45

1 Answers1

0

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

Céline Aussourd
  • 10,214
  • 4
  • 32
  • 36