docker

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Docker

type Docker struct {
	// Stdout and Stderr specify the process's standard output and error.
	//
	// If either is nil, Cmd Run connects the corresponding file descriptor
	// to the null device (os.DevNull).
	Stdout io.Writer
	Stderr io.Writer
}

Docker wraps several docker commands.

A Docker instance can be reused after calling its methods.

func New

func New() *Docker

New returns the Docker struct for executing docker commands.

func (*Docker) AnnotateManifest

func (d *Docker) AnnotateManifest(image string, manifestName string, arch string, variant string) error

AnnotateManifest adds additional information to a local image manifest. (!IMPORTANT: local,local,local!)

func (*Docker) ClearLocalManifests

func (d *Docker) ClearLocalManifests() error

ClearLocalManifests clears all local manifest lists. It is better to call this method before you want to create a manifest list.

func (*Docker) CreateManifest

func (d *Docker) CreateManifest(image string, manifestName string) error

CreateManifest creates a local manifest list. (!IMPORTANT: local,local,local!)

func (*Docker) GetImages

func (d *Docker) GetImages(imagePrefix string) ([]string, error)

GetImages returns docker images which match given image prefix.

func (*Docker) GetNameArchTag

func (d *Docker) GetNameArchTag(image string) (name string, arch string, tag string, err error)

GetNameArchTag returns the name, arch & tag of the given image. If the tag is <none>, return err. If the image doesn't contain an arch suffix, arch = "".

func (*Docker) Healthz added in v1.3.1

func (d *Docker) Healthz() bool

Healthz check docker daemon healthz status.

func (*Docker) LoadImages

func (d *Docker) LoadImages(imagesFile string) error

LoadImages loads images from a tar archive file.

func (*Docker) PushArm64Variants

func (d *Docker) PushArm64Variants(image string, name string, tag string) error

PushArm64Variants accepts an arm64 image, and creates another two variants that refer to this image. The manifest of this arm64 image is updated accordingly. Current variants: unknown, v8.

func (*Docker) PushImage

func (d *Docker) PushImage(image string) error

PushImage pushes an image.

func (*Docker) PushImageWithArch

func (d *Docker) PushImageWithArch(image string, manifestName string,
	arch string, variant string, needPushManifest bool) error

PushImageWithArch pushes an image which has a suffix about arch.

It will create/amend local manifest of the image, and push the updated local manifest to registry if need. (For speed up processing, it is better to push manifests after all changes have made.)

func (*Docker) PushManifest

func (d *Docker) PushManifest(manifestName string, needPurge bool) error

PushManifest pushes a manifest list.

func (*Docker) RemoveContainers

func (d *Docker) RemoveContainers(containers ...string) error

RemoveContainers forces to remove one or more running containers.

func (*Docker) RemoveImage

func (d *Docker) RemoveImage(image string) error

RemoveImage removes a local image.

func (*Docker) RunImage

func (d *Docker) RunImage(image string, options string, runArgs string) error

RunImage derives a running container from an image.

func (*Docker) SplitImageNameAndTag

func (d *Docker) SplitImageNameAndTag(image string) (name string, tag string, err error)

SplitImageNameAndTag returns the name & tag of the given image. If the tag is <none>, return err.

func (*Docker) SplitNameAndArch

func (d *Docker) SplitNameAndArch(name string) (string, string)

SplitNameAndArch returns the real name & arch of the given name. If the name doesn't contain an arch suffix, arch = "".

func (*Docker) TagImage

func (d *Docker) TagImage(srcImage string, destImage string) error

TagImage creates a tag destImage that refers to srcImage.

Jump to

Keyboard shortcuts

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