mesosphere-backup / deimos

Mesos containerizer hooks for Docker
Apache License 2.0
249 stars 26 forks source link

Unable to launch container from Marathon without privileged option #20

Closed jplock closed 10 years ago

jplock commented 10 years ago

I'm trying to following this tutorial (http://mesosphere.io/learn/run-docker-on-mesosphere/) using the latest version of Docker (1.0.1). I can't seem to get Marathon to launch the container through deimos unless I launch it with the --privileged option.

{
  "container": {
    "image": "docker:///libmesos/ubuntu",
    "options": ["--privileged"]
  },
  "id": "ubuntu",
  "instances": "1",
  "cpus": ".5",
  "mem": "300",
  "uris": [ ],
  "cmd": "sleep 500"
}

Is this a known issue or am I executing it incorrectly. I'm launching docker as /usr/bin/docker -d -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock

MikeMichel commented 10 years ago

Hi,

try

{
  "container": {
    "image": "docker:///libmesos/ubuntu",
    "options": ["--privileged=false"]
  },
  "id": "ubuntu",
  "instances": "1",
  "cpus": ".5",
  "mem": "300",
  "uris": [ ],
  "cmd": "sleep 500"
}

Mike

jplock commented 10 years ago

That worked, and --privileged=true worked, but I don't have the privileged option at all, the container never starts up.

solidsnack commented 10 years ago

Wow, never seen this one before. Is Deimos configured to use the UNIX socket or the TCP socket to talk to Docker?

jplock commented 10 years ago

I've removed any special startup configuration on docker, so by default, I believe it just listens on the socket and not TCP. I'll keep playing around with it to see if I can figure out what's going on.

I installed mesos from the mesosphere APT repo and installed deimos 0.3.2 from pip.

jplock commented 10 years ago

I've put up some files I'm testing with in https://gist.github.com/jplock/b80a3979d590b041fc4c

I'm able to start up ubuntu-true.json and ubuntu-false.json fine, but ubuntu-missing.json never starts up.

I'm launching the by executing:

curl -X POST -H "Content-Type: application/json" -d @ubuntu-true.json localhost:8080/v2/apps

solidsnack commented 10 years ago

This appears to be a serialization bug in Marathon. The following JSON works:

{
  "container": {
    "image": "docker:///libmesos/ubuntu",
    "options": []
  },
  "id": "ubuntu-missing",
  "instances": "1",
  "cpus": ".5",
  "mem": "300",
  "uris": [ ],
  "cmd": "sleep 500"
}
j1n6 commented 10 years ago

Is there a followup bug fix in Marathon? or somewhere I can track this issue in Marathon?