0

Hi I have been successfull so far with simple jobs in marathon but it stuck when i have tried deploying a deocker job in mesos through marathon framework.

I am using a json file as below to deploy a docker job:

{
  "id": "pga-docker",
  "cpus": 0.2,
  "mem": 1024.0,
  "instances": 1,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "pga",
      "network": "BRIDGE",
      "portMappings": [
        { "containerPort": 80, "hostPort": 6565, "servicePort": 0, "protocol": "tcp" }
      ]
    }
  }
}

My pga docker image have no problem when run as container, but through marathon its just not working. Its staying in the deploying state forever.

I am using the below command line:

curl -X POST http://10.141.141.10:8080/v2/apps -d @basic-3.json -H "Content-type: application/json"

But when I run the same image from marathon UI, its working. To run from marathon I used "docker run --publish 6060:80 --name test --rm pga" in the cmd field of the UI new job page.

Any one have idea why this is hanged in the command line approach?

psaha4
  • 339
  • 3
  • 17

1 Answers1

0

This is what i have found during some trial and error with the json file.

I found that when we run docker image in local system, if we have mentioned an entry point or a cmd then that will execute while running the container. But this is not same for mesos/marathon. my observation is that if I explicitly mentioned cmd in the deployment json then its working fine.

"cmd":"sh pga-setup.sh"

I will love to know if anyone faced a similar issue an solved it by another way.

psaha4
  • 339
  • 3
  • 17