Version: v0.0.3 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2019 License: MIT Imports: 16 Imported by: 0



Package dockerclient is a docker client that only uses types defined in docker. It is an example for httpclient package, it is currently in tree and will be moved to its own repo



View Source
const (
	DefaultVersion   = "1.37"
	DefaultLocalHost = "unix:///var/run/docker.sock"


This section is empty.


func DecodeDockerError

func DecodeDockerError(status int, body []byte, res *http.Response) (decodedError error)


type Client

type Client struct {
	// contains filtered or unexported fields

func New

func New(host string) (*Client, error)

func (*Client) ContainerExecAttach added in v0.0.3

func (dc *Client) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (net.Conn, error)

TODO: Attach is using the same start API but hijack the raw stream NOTE: docker is using the deprecated httputil.ClientConn

func (*Client) ContainerLog added in v0.0.3

func (dc *Client) ContainerLog(ctx context.Context, containerNameOrId string, options types.ContainerLogsOptions) (io.ReadCloser, error)

docker run --name test -d busybox sh -c "while true; do $(echo date); sleep 1; done"

func (*Client) Ping

func (dc *Client) Ping() (types.Ping, error)

func (*Client) Version

func (dc *Client) Version() (types.Version, error)

type ErrDocker

type ErrDocker struct {
	Method httputil.Method
	Url    string
	Path   string
	Status int
	// Message is the decoded error message from docker daemon
	Message string
	Body    string

func (*ErrDocker) Error

func (e *ErrDocker) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL