Skip to content

Commit c41c238

Browse files
author
Ian Campbell
committed
Disable docker system dial-stdio on Windows
The `conn` here is `*winio.win32MessageBytePipe` which does not have a `CloseRead` method (it does have `CloseWrite`) resulting in: docker@WIN-NUC0 C:\Users\docker>.\docker-windows-amd64.exe system dial-stdio the raw stream connection does not implement halfCloser Also disable the path which uses this for cli-plugins on Windows. Signed-off-by: Ian Campbell <[email protected]>
1 parent 8ddde26 commit c41c238

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

cli-plugins/plugin/plugin.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"fmt"
66
"os"
7+
"runtime"
78
"sync"
89

910
"github.com/docker/cli/cli"
@@ -74,7 +75,11 @@ func PersistentPreRunE(cmd *cobra.Command, args []string) error {
7475
}
7576
// flags must be the original top-level command flags, not cmd.Flags()
7677
options.opts.Common.SetDefaultOptions(options.flags)
77-
err = options.dockerCli.Initialize(options.opts, withPluginClientConn(options.name))
78+
var initopts []command.InitializeOpt
79+
if runtime.GOOS != "windows" {
80+
initopts = append(initopts, withPluginClientConn(options.name))
81+
}
82+
err = options.dockerCli.Initialize(options.opts, initopts...)
7883
})
7984
return err
8085
}

cli/command/system/cmd.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package system
22

33
import (
4+
"runtime"
5+
46
"github.com/docker/cli/cli"
57
"github.com/docker/cli/cli/command"
68
"github.com/spf13/cobra"
@@ -19,8 +21,12 @@ func NewSystemCommand(dockerCli command.Cli) *cobra.Command {
1921
NewInfoCommand(dockerCli),
2022
newDiskUsageCommand(dockerCli),
2123
newPruneCommand(dockerCli),
22-
newDialStdioCommand(dockerCli),
2324
)
25+
if runtime.GOOS != "windows" {
26+
cmd.AddCommand(
27+
newDialStdioCommand(dockerCli),
28+
)
29+
}
2430

2531
return cmd
2632
}

0 commit comments

Comments
 (0)