docker

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDomain    = "docker.io"
	OfficialRepoName = "library"
)

Defaults useful when constructing fully qualified image refs. Sourced from https://github.com/moby/moby/blob/master/vendor/github.com/docker/distribution/reference/normalize.go#L14

Variables

This section is empty.

Functions

func EncodeRegistryAuth

func EncodeRegistryAuth(username, password string) string

func FindDigest

func FindDigest(s string) string

FindDigest finds a digest within a string. If it is found the digest is returned, otherwise returns the empty string.

func PullImage

func PullImage(ctx context.Context, puller ImagePuller, image, registryAuth string, onUpdate func(*PullOrPush)) (string, error)

func PushImage

func PushImage(ctx context.Context, pusher ImagePusher, image, registryAuth string, onUpdate func(*PullOrPush)) (string, error)

Types

type ImagePuller

type ImagePuller interface {
	ImagePull(ctx context.Context, image string, pushOptions dockerTypes.ImagePullOptions) (io.ReadCloser, error)
}

type ImagePusher

type ImagePusher interface {
	ImagePush(ctx context.Context, image string, pushOptions dockerTypes.ImagePushOptions) (io.ReadCloser, error)
}

type PullOrPush

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

func NewPull

func NewPull(r io.Reader) *PullOrPush

func NewPush

func NewPush(r io.Reader) *PullOrPush

func (*PullOrPush) Progress

func (d *PullOrPush) Progress() float64

func (*PullOrPush) Wait

func (d *PullOrPush) Wait(onUpdate func(*PullOrPush)) (string, error)

Wait processes a JSON stream (the body of an image pull docker HTTP response) and returns an error as soon as an error is encountered in the stream, or the digest could not be parsd aftere processing the entire stream. Otherwise, it returns the digest string and a no error. onUpdate is called whenever d.Progress() may return a different value from the previous call.

type Userinfo

type Userinfo struct {
	UID   *int64
	User  string
	GID   *int64
	Group string
}

func ParseUserinfo

func ParseUserinfo(userinfoRaw string) (*Userinfo, error)

ParseUserinfo parses a string into a user and group. The string is interpreted exactly as the docker run command would interpret it.

Jump to

Keyboard shortcuts

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