mesosphere / marathon

Deploy and manage containers (including Docker) on top of Apache Mesos at scale.
https://mesosphere.github.io/marathon/
Apache License 2.0
4.07k stars 845 forks source link

docker run and mkdir #1571

Closed blackfader closed 9 years ago

blackfader commented 9 years ago

hi all marathon+mesos schedule docker is wonderful! but , I have a problem , I want to “create a docker ” have these steps: first "mkdir docker volume dir" in node machine. next "docker run -d image" in node machine next "btrfs quota subvolume" in node machine

use marathon api , I can 
     curl -X POST -H "Content-Type: application/json" http://xxx:8080/v2/apps -d{"id": "test",
"cmd": "env && sleep 300",
"container": {
  "docker": {
    "image": "php:5.5",
    "network": "BRIDGE",
    "portMappings": [
                {
                    "containerPort": 80,
                    "hostPort": 0,
                    "servicePort": 9000,
                    "protocol": "tcp"
                }]
  }
},
"cpus": 0.2,
"mem": 512.0,
"instances": 1
}

this way just "docker run -d image" in node machine , but I can't "mkdir volume" and "btrfs quota".

Is there a way to do this ?

blackfader commented 9 years ago

@kolloch , Excuse me,Is there a way to do this ?,thanks .

kolloch commented 9 years ago

Hi @blackfader,

you would need to run some script before launching your docker container? No, sorry, that is not supported.

You could use a non-docker app definition and run the commands including the "docker run" yourself.