Documentation ¶
Index ¶
- type Docker
- func (d *Docker) AnnotateManifest(image string, manifestName string, arch string, variant string) error
- func (d *Docker) BuildImage(dockerfile []byte, target, platform string) error
- func (d *Docker) ClearLocalManifests() error
- func (d *Docker) CreateManifest(image string, manifestName string) error
- func (d *Docker) GetImages(imagePrefix string) ([]string, error)
- func (d *Docker) GetNameArchTag(image string) (name string, arch string, tag string, err error)
- func (d *Docker) Healthz() bool
- func (d *Docker) LoadImages(imagesFile string) error
- func (d *Docker) PushArm64Variants(image string, name string, tag string) error
- func (d *Docker) PushImage(image string) error
- func (d *Docker) PushImageWithArch(image string, manifestName string, arch string, variant string, ...) error
- func (d *Docker) PushManifest(manifestName string, needPurge bool) error
- func (d *Docker) RemoveContainers(containers ...string) error
- func (d *Docker) RemoveImage(image string) error
- func (d *Docker) RunImage(image string, options string, runArgs string) error
- func (d *Docker) SplitImageNameAndTag(image string) (name string, tag string, err error)
- func (d *Docker) SplitNameAndArch(name string) (string, string)
- func (d *Docker) TagImage(srcImage string, destImage string) error
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 (*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) BuildImage ¶ added in v1.6.0
BuildImage from dockerfile
func (*Docker) ClearLocalManifests ¶
ClearLocalManifests clears all local manifest lists. It is better to call this method before you want to create a manifest list.
func (*Docker) CreateManifest ¶
CreateManifest creates a local manifest list. (!IMPORTANT: local,local,local!)
func (*Docker) GetNameArchTag ¶
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) LoadImages ¶
LoadImages loads images from a tar archive file.
func (*Docker) PushArm64Variants ¶
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) 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 ¶
PushManifest pushes a manifest list.
func (*Docker) RemoveContainers ¶
RemoveContainers forces to remove one or more running containers.
func (*Docker) RemoveImage ¶
RemoveImage removes a local image.
func (*Docker) SplitImageNameAndTag ¶
SplitImageNameAndTag returns the name & tag of the given image. If the tag is <none>, return err.
func (*Docker) SplitNameAndArch ¶
SplitNameAndArch returns the real name & arch of the given name. If the name doesn't contain an arch suffix, arch = "".