Windows doesn't have 'host' mode networking, so use 'auto'.

That means 'null', not that we can call builder-next on Windows. If and
when we do get builder-next going, this will need to be solved properly
in some way.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paul "TBBle" Hampson 2023-06-14 11:31:09 +09:00 committed by Paweł Gronowski
parent 66325f7271
commit ec041193f9
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -5,6 +5,7 @@ import (
"net/http"
"os"
"path/filepath"
"runtime"
"time"
ctd "github.com/containerd/containerd"
@ -91,6 +92,14 @@ func newSnapshotterController(ctx context.Context, rt http.RoundTripper, opt Opt
nc := netproviders.Opt{
Mode: "host",
}
// HACK! Windows doesn't have 'host' mode networking.
if runtime.GOOS == "windows" {
nc = netproviders.Opt{
Mode: "auto",
}
}
dns := getDNSConfig(opt.DNSConfig)
wo, err := containerd.NewWorkerOpt(opt.Root, opt.ContainerdAddress, opt.Snapshotter, opt.ContainerdNamespace,