dockerinit: propagate "container" env variable from lxc

Lxc (and libvirt) already set the "container" env variable
appropriately[1], so just use that.

[1] http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
Upstream-commit: e8772943215fff3e17642ad410e4815e40e96b8b
Component: engine
This commit is contained in:
Josh Poimboeuf
2013-11-08 16:15:11 -06:00
parent 5570b7b013
commit 8538072ed6
2 changed files with 3 additions and 1 deletions

View File

@ -586,7 +586,6 @@ func (container *Container) Start() (err error) {
env := []string{
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"container=lxc",
"HOSTNAME=" + container.Config.Hostname,
}

View File

@ -191,6 +191,9 @@ func SysInit() {
log.Fatalf("Unable to unmarshal environment variables: %v", err)
}
// Propagate the plugin-specific container env variable
env = append(env, "container="+os.Getenv("container"))
args := &DockerInitArgs{
user: *user,
gateway: *gateway,