mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon: ensure systemd cgroup is passed down to runtimes
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
91fdafb79f
commit
7f88fca48e
2 changed files with 4 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue