docker

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRegistry = "https://index.docker.io/v1/"

DefaultRegistry is the registry for that authentication data is used

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a docker client

func NewClient

func NewClient(debugLogFn func(string, ...interface{})) (*Client, error)

NewClient initializes a new docker client. It supports the same environment variables then NewClientwAuth(). The Auth configuration is read from the user's config.json file for an Upload() operation. The following files are checked in the order listed: - $DOCKER_CONFIG/config.json if DOCKER_CONFIG set in the environment, - $HOME/.docker/config.json - $HOME/.dockercfg If reading auth data from the config fails, a message is logged via the debugLogFn function but no error is returned. An Upload() operation would be done without authentication.

func NewClientwAuth

func NewClientwAuth(debugLogFn func(string, ...interface{}), username, password string) (*Client, error)

NewClientwAuth intializes a new docker client. The username and password is used to authenticate at the registry for an Upload() = docker push) operation. The following environment variables are respected: Use DOCKER_HOST to set the url to the docker server. Use DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest. Use DOCKER_CERT_PATH to load the TLS certificates from. Use DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default.

func (*Client) Size

func (c *Client) Size(imageID string) (int64, error)

Size returns the size of an image in Bytes

func (*Client) Upload

func (c *Client) Upload(image, destURI string) (string, error)

Upload tags and uploads an image into a docker registry repository destURI format: [<server[:port]>/]<owner>/<repository>:<tag>

Jump to

Keyboard shortcuts

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