mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #10527 from mfojtik/lxc_11
Fix lxc-start in lxc>1.1.0 where containers start daemonized by default
This commit is contained in:
commit
22dba32b4d
1 changed files with 8 additions and 0 deletions
|
@ -20,6 +20,7 @@ import (
|
|||
"github.com/docker/docker/daemon/execdriver"
|
||||
sysinfo "github.com/docker/docker/pkg/system"
|
||||
"github.com/docker/docker/pkg/term"
|
||||
"github.com/docker/docker/pkg/version"
|
||||
"github.com/docker/docker/utils"
|
||||
"github.com/docker/libcontainer"
|
||||
"github.com/docker/libcontainer/cgroups"
|
||||
|
@ -118,6 +119,13 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
|
|||
"-n", c.ID,
|
||||
"-f", configPath,
|
||||
}
|
||||
|
||||
// From lxc>=1.1 the default behavior is to daemonize containers after start
|
||||
lxcVersion := version.Version(d.version())
|
||||
if lxcVersion.GreaterThanOrEqualTo(version.Version("1.1")) {
|
||||
params = append(params, "-F")
|
||||
}
|
||||
|
||||
if c.Network.ContainerID != "" {
|
||||
params = append(params,
|
||||
"--share-net", c.Network.ContainerID,
|
||||
|
|
Loading…
Reference in a new issue