From adb07b53e083784e4f09935b8e3bdcf123db284e Mon Sep 17 00:00:00 2001 From: Abin Shahab Date: Tue, 11 Nov 2014 08:52:41 +0000 Subject: [PATCH] LINKED CONTAINER ID PASSED TO LXC This passed the --net=container:CONTINER_ID to lxc-start as --share-net Docker-DCO-1.1-Signed-off-by: Abin Shahab (github: ashahab-altiscale) --- daemon/execdriver/lxc/driver.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/daemon/execdriver/lxc/driver.go b/daemon/execdriver/lxc/driver.go index 7583a3e64f..ec99bf5e50 100644 --- a/daemon/execdriver/lxc/driver.go +++ b/daemon/execdriver/lxc/driver.go @@ -86,10 +86,17 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba "lxc-start", "-n", c.ID, "-f", configPath, - "--", - c.InitPath, + } + if c.Network.ContainerID != "" { + params = append(params, + "--share-net", c.Network.ContainerID, + ) } + params = append(params, + "--", + c.InitPath, + ) if c.Network.Interface != nil { params = append(params, "-g", c.Network.Interface.Gateway,