package connhelper

import "github.com/docker/cli/cli/connhelper"

Package connhelper provides helpers for connecting to a remote daemon host with custom logic.

Index

Types

type ConnectionHelper

type ConnectionHelper struct {
	Dialer func(ctx context.Context, network, addr string) (net.Conn, error)
	Host   string // dummy URL used for HTTP requests. e.g. "http://docker"
}

ConnectionHelper allows to connect to a remote host with custom stream provider binary.

func GetCommandConnectionHelper

func GetCommandConnectionHelper(cmd string, flags ...string) (*ConnectionHelper, error)

GetCommandConnectionHelper returns Docker-specific connection helper constructed from an arbitrary command.

func GetConnectionHelper

func GetConnectionHelper(daemonURL string) (*ConnectionHelper, error)

GetConnectionHelper returns Docker-specific connection helper for the given URL. GetConnectionHelper returns nil without error when no helper is registered for the scheme.

ssh://<user>@<host> URL requires Docker 18.09 or later on the remote host.

func GetConnectionHelperWithSSHOpts

func GetConnectionHelperWithSSHOpts(daemonURL string, sshFlags []string) (*ConnectionHelper, error)

GetConnectionHelperWithSSHOpts returns Docker-specific connection helper for the given URL, and accepts additional options for ssh connections. It returns nil without error when no helper is registered for the scheme.

Requires Docker 18.09 or later on the remote host.

Source Files

connhelper.go

Directories

PathSynopsis
cli/connhelper/commandconnPackage commandconn provides a net.Conn implementation that can be used for proxying (or emulating) stream via a custom command.
cli/connhelper/sshPackage ssh provides the connection helper for ssh:// URL.
Version
v23.0.3+incompatible
Published
Mar 31, 2023
Platform
linux/amd64
Imports
6 packages
Last checked
4 seconds ago

Tools for package owners.