dockerclient

package
v0.0.0-...-89e0d77 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDockerHost defines os specific default if DOCKER_HOST is unset
	DefaultDockerHost = "unix:///var/run/docker.sock"
)

Variables

View Source
var ErrRedirect = errors.New("unexpected redirect in response")

ErrRedirect is the error returned by checkRedirect when the request is non-GET.

Functions

func CheckRedirect

func CheckRedirect(req *http.Request, via []*http.Request) error

CheckRedirect specifies the policy for dealing with redirect responses: If the request is non-GET return `ErrRedirect`. Otherwise use the last response.

Go 1.8 changes behavior for HTTP redirects (specifically 301, 307, and 308) in the client . The Docker client (and by extension docker API client) can be made to to send a request like POST /containers//start where what would normally be in the name section of the URL is empty. This triggers an HTTP 301 from the daemon. In go 1.8 this 301 will be converted to a GET request, and ends up getting a 404 from the daemon. This behavior change manifests in the client in that before the 301 was not followed and the client did not generate an error, but now results in a message like Error response from daemon: page not found.

func FindSupportedAPIVersions

func FindSupportedAPIVersions() docker.APIVersions

Types

type Client

type Client interface {
	dockeriface.Client
}

Client is the interface

func New

func New(version string) (Client, error)

New creates a new docker client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL