mirror of
https://github.com/moby/moby.git
synced 2026-08-07 08:31:39 +00:00
Merge pull request #26045 from runcom/systemd-cgroup-fix
daemon: ensure systemd cgroup is passed down to runtimes
This commit is contained in:
@@ -566,11 +566,7 @@ func verifyDaemonSettings(config *Config) error {
|
||||
if config.Runtimes == nil {
|
||||
config.Runtimes = make(map[string]types.Runtime)
|
||||
}
|
||||
stockRuntimeOpts := []string{}
|
||||
if UsingSystemd(config) {
|
||||
stockRuntimeOpts = append(stockRuntimeOpts, "--systemd-cgroup=true")
|
||||
}
|
||||
config.Runtimes[stockRuntimeName] = types.Runtime{Path: DefaultRuntimeBinary, Args: stockRuntimeOpts}
|
||||
config.Runtimes[stockRuntimeName] = types.Runtime{Path: DefaultRuntimeBinary}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Contain
|
||||
if rt == nil {
|
||||
return nil, fmt.Errorf("no such runtime '%s'", container.HostConfig.Runtime)
|
||||
}
|
||||
if UsingSystemd(daemon.configStore) {
|
||||
rt.Args = append(rt.Args, "--systemd-cgroup=true")
|
||||
}
|
||||
createOptions = append(createOptions, libcontainerd.WithRuntime(rt.Path, rt.Args))
|
||||
|
||||
return &createOptions, nil
|
||||
|
||||
Reference in New Issue
Block a user