From 62cb0285c37807f02167f9e1d59706076212baae Mon Sep 17 00:00:00 2001 From: Tom Arnfeld Date: Sat, 1 Nov 2014 15:59:17 +0000 Subject: [PATCH] Set the docker graph path instead of a volume DockerInDocker requires you mount the docker graph into a volume, since AUFS *inside* AUFS is tricky business. Instead of making use of some magical environment varaible and mounting a volume, we can now configure the graph path to a directory inside of the sandbox (jpetazzo/dind#39) --- portainer/app/executor.py | 7 ++++++- portainer/app/scheduler.py | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/portainer/app/executor.py b/portainer/app/executor.py index ca489c4..6b1cf06 100644 --- a/portainer/app/executor.py +++ b/portainer/app/executor.py @@ -69,7 +69,12 @@ def registered(self, driver, executorInfo, frameworkInfo, slaveInfo): def launch_docker_daemon(): logger.info("Launching docker daemon subprocess") - # TODO(tarnfeld): This should be made a little more flexible + env = dict(os.environ) + env["DOCKER_DAEMON_ARGS"] = "-g %s" % ( + os.path.join(env["MESOS_DIRECTORY"], "docker") + ) + + # Use the `wrapdocker` script included in our docker image proc = subprocess.Popen(["/usr/local/bin/wrapdocker"]) self.docker = docker.Client() diff --git a/portainer/app/scheduler.py b/portainer/app/scheduler.py index 33895bf..1adf6c5 100644 --- a/portainer/app/scheduler.py +++ b/portainer/app/scheduler.py @@ -350,7 +350,6 @@ def handle_exception(e): # We have to mount the /var/lib/docker VOLUME inside of the sandbox task.executor.command.container.options.extend(["--privileged"]) - task.executor.command.container.options.extend(["-v", "$MESOS_DIRECTORY/docker:/var/lib/docker"]) task.executor.name = "build" task.executor.source = "portainer"