2021-08-23 13:14:53 +00:00
|
|
|
//go:build !windows
|
2016-06-07 07:45:21 +00:00
|
|
|
|
2018-02-05 21:05:59 +00:00
|
|
|
package daemon // import "github.com/docker/docker/daemon"
|
2016-05-23 21:49:50 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/docker/docker/container"
|
|
|
|
)
|
|
|
|
|
2017-09-22 13:52:41 +00:00
|
|
|
// getLibcontainerdCreateOptions callers must hold a lock on the container
|
2022-08-31 20:12:30 +00:00
|
|
|
func (daemon *Daemon) getLibcontainerdCreateOptions(daemonCfg *configStore, container *container.Container) (string, interface{}, error) {
|
2016-06-20 18:21:01 +00:00
|
|
|
// Ensure a runtime has been assigned to this container
|
|
|
|
if container.HostConfig.Runtime == "" {
|
2022-08-31 21:24:22 +00:00
|
|
|
container.HostConfig.Runtime = daemonCfg.Runtimes.Default
|
2017-03-27 17:18:53 +00:00
|
|
|
container.CheckpointTo(daemon.containersReplica)
|
2016-06-20 18:21:01 +00:00
|
|
|
}
|
|
|
|
|
2022-08-31 20:12:30 +00:00
|
|
|
shim, opts, err := daemonCfg.Runtimes.Get(container.HostConfig.Runtime)
|
2021-01-04 19:43:19 +00:00
|
|
|
if err != nil {
|
2022-08-24 10:44:05 +00:00
|
|
|
return "", nil, setExitCodeFromError(container.SetExitCode, err)
|
2016-08-26 13:33:26 +00:00
|
|
|
}
|
2016-05-23 21:49:50 +00:00
|
|
|
|
2022-08-31 20:12:30 +00:00
|
|
|
return shim, opts, nil
|
2016-05-23 21:49:50 +00:00
|
|
|
}
|