This project is an implementation of an External Containerizer for Apache Mesos, that allows Mesos Executors/Tasks to be launched inside a Docker container. This is especially useful as a mechanism for managing system dependencies, since you no longer need to ensure all of the Mesos slaves have everything installed.
This containerizer supports both the historic CommandInfo.ContainerInfo
protobuf message and the new root ContainerInfo
message. Effectively this containerizer can also be used in conjunction with the built-in mesos/docker containerizer released in 0.20.0.
You can configure various attributes of the containerizer using environment variables. If you wish to modify these, copy ./bin/environment.sh.dist
to ./bin/environment.sh
and change the values.
First, launch a mesos master.
$ ./bin/mesos-master.sh --ip=127.0.0.1
...
You now need to ensure the slave is configured to use external
containerization, and give it the path to the docker containerizer.
$ ./bin/mesos-slave.sh --master=127.0.0.1:5050 \
--isolation="external" \
--containerizer_path="/path/to/this/repo/bin/docker-containerizer"
With the above slave, any tasks that are sent to the slave must contain container information otherwise they will be unable to run. You can configure a default image to allow users to submit tasks without this information, with --default_container_image
.
The ./example
folder contains a Vagrantfile
that launches a vagrant VM ready and waiting for testing the containerizer.
- Installs docker
- Installs mesos 0.21 fromthe mesosphere apt repository.
mesos-master
andmesos-slave
will be availble on your path. - Mounts this repo into
/opt/mesos-docker-containerizer
The VM doesn't launch a running mesos master or slave, you'll need to log in via vagrant ssh
and use mesos-master
and mesos-slave
with appropriate arguments to do that yourself.