docker

package
v0.0.0-...-2853c3c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auther

type Auther interface {
	// DockerAuth should return docker auth credentials that will authenticate
	// against a docker registry for a given drivers.ContainerTask.Image(). An
	// error may be returned which will cause the task not to be run, this can be
	// useful for an implementer to do things like testing auth configurations
	// before returning them; e.g. if the implementer would like to impose
	// certain restrictions on images or if credentials must be acquired right
	// before runtime and there's an error doing so. If these credentials don't
	// work, the docker pull will fail and the task will be set to error status.
	DockerAuth() (docker.AuthConfiguration, error)
}

A drivers.ContainerTask should implement the Auther interface if it would like to use not-necessarily-public docker images for any or all task invocations.

type DockerDriver

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

func NewDocker

func NewDocker(conf drivers.Config) *DockerDriver

implements drivers.Driver

func (*DockerDriver) Prepare

func (drv *DockerDriver) Prepare(ctx context.Context, task drivers.ContainerTask) (drivers.Cookie, error)

type Sizer

type Sizer interface {
	Size() (int64, error)
}

Sizer returns size information. This interface is liable to contain more than a size at some point, change as needed.

func CheckRegistry

func CheckRegistry(ctx context.Context, image string, config docker.AuthConfiguration) (Sizer, error)

CheckRegistry will return a sizer, which can be used to check the size of an image if the returned error is nil. If the error returned is nil, then authentication against the given credentials was successful, if the configuration or image do not specify a config.ServerAddress, https://hub.docker.com will be tried. CheckRegistry is a package level method since rkt can also use docker images, we may be interested in using rkt w/o a docker driver configured; also, we don't have to tote around a driver in any tasker that may be interested in registry information (2/2 cases thus far).

Jump to

Keyboard shortcuts

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