diff options
author | Brian Goff <cpuguy83@gmail.com> | 2020-07-07 13:33:46 -0700 |
---|---|---|
committer | Brian Goff <cpuguy83@gmail.com> | 2020-07-13 14:18:02 -0700 |
commit | f63f73a4a8f531813d6b46a2347cab4bfd210df7 (patch) | |
tree | 7723cae5a0560466972f3c45d3a10d109a2b18e6 /daemon/start_windows.go | |
parent | 6fd94aa933f774dc6f582a96f800b1e875628be3 (diff) | |
download | docker-f63f73a4a8f531813d6b46a2347cab4bfd210df7.tar.gz |
Configure shims from runtime config
In dockerd we already have a concept of a "runtime", which specifies the
OCI runtime to use (e.g. runc).
This PR extends that config to add containerd shim configuration.
This option is only exposed within the daemon itself (cannot be
configured in daemon.json).
This is due to issues in supporting unknown shims which will require
more design work.
What this change allows us to do is keep all the runtime config in one
place.
So the default "runc" runtime will just have it's already existing shim
config codified within the runtime config alone.
I've also added 2 more "stock" runtimes which are basically runc+shimv1
and runc+shimv2.
These new runtime configurations are:
- io.containerd.runtime.v1.linux - runc + v1 shim using the V1 shim API
- io.containerd.runc.v2 - runc + shim v2
These names coincide with the actual names of the containerd shims.
This allows the user to essentially control what shim is going to be
used by either specifying these as a `--runtime` on container create or
by setting `--default-runtime` on the daemon.
For custom/user-specified runtimes, the default shim config (currently
shim v1) is used.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Diffstat (limited to 'daemon/start_windows.go')
-rw-r--r-- | daemon/start_windows.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/daemon/start_windows.go b/daemon/start_windows.go index fc34375e7e..d21fec5d70 100644 --- a/daemon/start_windows.go +++ b/daemon/start_windows.go @@ -7,12 +7,12 @@ import ( "github.com/docker/docker/pkg/system" ) -func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Container) (interface{}, error) { +func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Container) (string, interface{}, error) { // Set the runtime options to debug regardless of current logging level. if system.ContainerdRuntimeSupported() { opts := &options.Options{Debug: true} - return opts, nil + return "", opts, nil } // TODO (containerd) - Probably need to revisit LCOW options here @@ -22,7 +22,7 @@ func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Contain if container.OS == "linux" { config := &client.Config{} if err := config.GenerateDefault(daemon.configStore.GraphOptions); err != nil { - return nil, err + return "", nil, err } // Override from user-supplied options. for k, v := range container.HostConfig.StorageOpt { @@ -34,11 +34,11 @@ func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Contain } } if err := config.Validate(); err != nil { - return nil, err + return "", nil, err } - return config, nil + return "", config, nil } - return nil, nil + return "", nil, nil } |