mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
Merge pull request #36124 from crosbymichael/exec
Use proc/exe for reexec Upstream-commit: 9d61e5c8c1d85f633643a8b9071393dc417d56dd Component: engine
This commit is contained in:
@@ -862,14 +862,10 @@ func (daemon *Daemon) createSpec(c *container.Container) (*specs.Spec, error) {
|
||||
|
||||
for _, ns := range s.Linux.Namespaces {
|
||||
if ns.Type == "network" && ns.Path == "" && !c.Config.NetworkDisabled {
|
||||
target, err := os.Readlink(filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
target := filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe")
|
||||
s.Hooks = &specs.Hooks{
|
||||
Prestart: []specs.Hook{{
|
||||
Path: target, // FIXME: cross-platform
|
||||
Path: target,
|
||||
Args: []string{"libnetwork-setkey", c.ID, daemon.netController.ID()},
|
||||
}},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user