libcontainerd_windows.go 710 B

12345678910111213141516171819
  1. package libcontainerd // import "github.com/docker/docker/libcontainerd"
  2. import (
  3. "context"
  4. "github.com/containerd/containerd"
  5. "github.com/docker/docker/libcontainerd/local"
  6. "github.com/docker/docker/libcontainerd/remote"
  7. libcontainerdtypes "github.com/docker/docker/libcontainerd/types"
  8. "github.com/docker/docker/pkg/system"
  9. )
  10. // NewClient creates a new libcontainerd client from a containerd client
  11. func NewClient(ctx context.Context, cli *containerd.Client, stateDir, ns string, b libcontainerdtypes.Backend) (libcontainerdtypes.Client, error) {
  12. if !system.ContainerdRuntimeSupported() {
  13. return local.NewClient(ctx, cli, stateDir, ns, b)
  14. }
  15. return remote.NewClient(ctx, cli, stateDir, ns, b)
  16. }