File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,15 @@ if [ "$CGO_ENABLED" = "1" ] && [ "$GO_LINKMODE" = "static" ]; then
102102 # compiling statically with CGO enabled requires osusergo and netgo to be set.
103103 GO_BUILDTAGS=" $GO_BUILDTAGS osusergo netgo"
104104fi
105+ # XXX: Disable netgo on Windows and use Windows system resolver instead.
106+ #
107+ # go1.19 and newer added support for netgo on Windows (https://go.dev/doc/go1.19#net),
108+ # which may not respect VPN adaptors (such as Twingate) due to resolver ordering,
109+ # resulting in queries being sent through the local network adapter instead of the
110+ # VPN tunnel. See https://github.com/docker/cli/issues/6665
111+ if [ " $( go env GOOS) " = " windows" ]; then
112+ GO_BUILDTAGS=$( echo " $GO_BUILDTAGS " | sed ' s/\(^\| \)netgo\( \|$\)/\1/g' )
113+ fi
105114if [ -n " $GO_STRIP " ]; then
106115 # if stripping enabled and building with llvm < 12 against darwin/amd64
107116 # platform, it will fail with:
You can’t perform that action at this time.
0 commit comments