Skip to content

Commit

Permalink
cli-plugins: disable use of dial-stdio
Browse files Browse the repository at this point in the history
Since docker#1654 so far we've had problems with it not working on Windows (npipe
lacked the `CloseRead` method) and problems with using tcp with tls (the tls
connection also lacks `CloseRead`). Both of these were workedaround in docker#1718
which added a nop `CloseRead` method.

However I am now seeing hangs (on Windows) where the `system dial-stdio`
subprocess is not exiting (I'm unsure why so far).

I think the 3rd problem found with this is an indication that `dial-stdio` is
not quite ready for wider use outside of its initial usecase (support for
`ssh://` URLs to connect to remote daemons).

This change simply disables the `dial-stdio` path for all plugins. However
rather than completely reverting 891b3d9 ("cli-plugins: use `docker system
dial-stdio` to call the daemon") I've just disabled the functionality at the
point of use and left in a trap door environment variable so that those who
want to experiment with this mode (and perhaps fully debug it) have an easier
path do doing so.

Signed-off-by: Ian Campbell <[email protected]>
  • Loading branch information
Ian Campbell committed Mar 18, 2019
1 parent 651ccc0 commit 556d7e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli-plugins/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ func runPlugin(dockerCli *command.DockerCli, plugin *cobra.Command, meta manager
PersistentPreRunE = func(_ *cobra.Command, _ []string) error {
var err error
persistentPreRunOnce.Do(func() {
err = tcmd.Initialize(withPluginClientConn(plugin.Name()))
var opts []command.InitializeOpt
if os.Getenv("DOCKER_CLI_PLUGIN_USE_DIAL_STDIO") != "" {
opts = append(opts, withPluginClientConn(plugin.Name()))
}
err = tcmd.Initialize(opts...)
})
return err
}
Expand Down

0 comments on commit 556d7e9

Please sign in to comment.