Browse code

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 <ashahab@altiscale.com> (github: ashahab-altiscale)

Abin Shahab authored on 2014/11/11 17:52:41
Showing 1 changed files
... ...
@@ -86,10 +86,17 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
86 86
 		"lxc-start",
87 87
 		"-n", c.ID,
88 88
 		"-f", configPath,
89
-		"--",
90
-		c.InitPath,
89
+	}
90
+	if c.Network.ContainerID != "" {
91
+		params = append(params,
92
+			"--share-net", c.Network.ContainerID,
93
+		)
91 94
 	}
92 95
 
96
+	params = append(params,
97
+		"--",
98
+		c.InitPath,
99
+	)
93 100
 	if c.Network.Interface != nil {
94 101
 		params = append(params,
95 102
 			"-g", c.Network.Interface.Gateway,