Created
September 9, 2015 19:07
-
-
Save leafmulch/48d1a76ecb567351a4ca to your computer and use it in GitHub Desktop.
Mesos and Marathon on docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I'll look at creating a docker-compose.yaml soon | |
docker run -d --name zookeeper -p 2181:2181 -p 2888:2888 -p 3888:3888 jplock/zookeeper | |
docker inspect --format '{{ .NetworkSettings.IPAddress }}' zookeeper # use ip for following zk:// reqs below | |
docker run -d --name mesos-master -e MESOS_WORK_DIR=/tmp -e MESOS_LOG_DIR=/var/log -e MESOS_ZK=zk://172.17.0.18:2181/mesos -e MESOS_QUORUM=1 -p 5050:5050 redjack/mesos-master | |
docker run -d --name mesos-slave -e MESOS_LOG_DIR=/var/log -e MESOS_MASTER=zk://172.17.0.18:2181/mesos -e MESOS_EXECUTOR_REGISTRATION_TIMEOUT=5mins -e MESOS_ISOLATOR=cgroups/cpu,cgroups/mem -e MESOS_CONTAINERIZERS=docker,mesos -v /run/docker.sock:/run/docker.sock -v /sys:/sys -v /proc:/host/proc:ro redjack/mesos-slave | |
docker inspect --format '{{ .NetworkSettings.IPAddress }}' mesos-master | |
docker run -d -p 8080:8080 --name marathon thefactory/marathon:latest --master 172.17.0.29:5050 --zk zk://172.17.0.25:2181/marathon | |
curl -X POST http://localhost:8081/v2/apps -d @nginx-bridge.json -H "Content-type: application/json" # example below | |
---- | |
{ | |
"container": { | |
"type": "DOCKER", | |
"docker": { | |
"image": "nginx", | |
"network": "BRIDGE", | |
"portMappings": [ | |
{ "containerPort": 80, "hostPort": 0, "servicePort": 80, "protocol": "tcp" } | |
] | |
} | |
}, | |
"id": "nginx", | |
"instances": 1, | |
"cpus": 0.25, | |
"mem": 256, | |
"uris": [] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment