From 1b12783c0cad3426c53fc468a612a394b684ffd4 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 29 Sep 2014 21:35:25 +0000 Subject: [PATCH] Update native driver to set RootFs Signed-off-by: Michael Crosby Upstream-commit: 532c29ef7deea38bed68506b785f067796a1836b Component: engine --- components/engine/daemon/execdriver/native/create.go | 1 + components/engine/daemon/execdriver/native/driver.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/engine/daemon/execdriver/native/create.go b/components/engine/daemon/execdriver/native/create.go index 7aee2d6cea..04bdf2b2ae 100644 --- a/components/engine/daemon/execdriver/native/create.go +++ b/components/engine/daemon/execdriver/native/create.go @@ -31,6 +31,7 @@ func (d *driver) createContainer(c *execdriver.Command) (*libcontainer.Config, e container.Cgroups.Name = c.ID container.Cgroups.AllowedDevices = c.AllowedDevices container.MountConfig.DeviceNodes = c.AutoCreatedDevices + container.RootFs = c.Rootfs // check to see if we are running in ramdisk to disable pivot root container.MountConfig.NoPivotRoot = os.Getenv("DOCKER_RAMDISK") != "" diff --git a/components/engine/daemon/execdriver/native/driver.go b/components/engine/daemon/execdriver/native/driver.go index 3367fad1f2..3628d7b575 100644 --- a/components/engine/daemon/execdriver/native/driver.go +++ b/components/engine/daemon/execdriver/native/driver.go @@ -100,7 +100,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba return -1, err } - return namespaces.Exec(container, c.ProcessConfig.Stdin, c.ProcessConfig.Stdout, c.ProcessConfig.Stderr, c.ProcessConfig.Console, c.Rootfs, dataPath, args, func(container *libcontainer.Config, console, rootfs, dataPath, init string, child *os.File, args []string) *exec.Cmd { + return namespaces.Exec(container, c.ProcessConfig.Stdin, c.ProcessConfig.Stdout, c.ProcessConfig.Stderr, c.ProcessConfig.Console, dataPath, args, func(container *libcontainer.Config, console, dataPath, init string, child *os.File, args []string) *exec.Cmd { c.ProcessConfig.Path = d.initPath c.ProcessConfig.Args = append([]string{ DriverName, @@ -117,7 +117,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba c.ProcessConfig.ExtraFiles = []*os.File{child} c.ProcessConfig.Env = container.Env - c.ProcessConfig.Dir = c.Rootfs + c.ProcessConfig.Dir = container.RootFs return &c.ProcessConfig.Cmd }, func() {