Skip to content

Commit

Permalink
Disable docker system dial-stdio on Windows
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Ian Campbell committed Mar 4, 2019
1 parent 8ddde26 commit c41c238
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cli-plugins/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"os"
"runtime"
"sync"

"github.com/docker/cli/cli"
Expand Down Expand Up @@ -74,7 +75,11 @@ func PersistentPreRunE(cmd *cobra.Command, args []string) error {
}
// flags must be the original top-level command flags, not cmd.Flags()
options.opts.Common.SetDefaultOptions(options.flags)
err = options.dockerCli.Initialize(options.opts, withPluginClientConn(options.name))
var initopts []command.InitializeOpt
if runtime.GOOS != "windows" {
initopts = append(initopts, withPluginClientConn(options.name))
}
err = options.dockerCli.Initialize(options.opts, initopts...)
})
return err
}
Expand Down
8 changes: 7 additions & 1 deletion cli/command/system/cmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package system

import (
"runtime"

"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"
Expand All @@ -19,8 +21,12 @@ func NewSystemCommand(dockerCli command.Cli) *cobra.Command {
NewInfoCommand(dockerCli),
newDiskUsageCommand(dockerCli),
newPruneCommand(dockerCli),
newDialStdioCommand(dockerCli),
)
if runtime.GOOS != "windows" {
cmd.AddCommand(
newDialStdioCommand(dockerCli),
)
}

return cmd
}

0 comments on commit c41c238

Please sign in to comment.