Documentation ¶
Overview ¶
Package docker contains helpers for working with docker This package has no stability guarantees whatsoever!
Package docker contains helpers for working with docker This package has no stability guarantees whatsoever!
Index ¶
- func ContainerCmder(containerNameOrID string) exec.Cmder
- func EditArchive(reader io.Reader, writer io.Writer, editRepositories func(string) string, ...) error
- func GetArchiveTags(path string) ([]string, error)
- func ImageID(containerNameOrID string) (string, error)
- func ImageInspect(containerNameOrID, format string) ([]string, error)
- func Pull(logger log.Logger, image string, platform string, retries int) error
- func Run(image string, runArgs []string, containerArgs []string) error
- func Save(image, dest string) error
- func SplitImage(image string) (registry, tag string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerCmder ¶
ContainerCmder creates a new exec.Cmder against a docker container
func EditArchive ¶ added in v0.11.0
func EditArchive(reader io.Reader, writer io.Writer, editRepositories func(string) string, architectureOverride string) error
EditArchive applies edit to reader's image repositories, IE the repository part of repository:tag in image tags This supports v1 / v1.1 / v1.2 Docker Image Archives
editRepositories should be a function that returns the input or an edited form, where the input is the image repository
https://github.com/moby/moby/blob/master/image/spec/v1.md https://github.com/moby/moby/blob/master/image/spec/v1.1.md https://github.com/moby/moby/blob/master/image/spec/v1.2.md
func GetArchiveTags ¶
GetArchiveTags obtains a list of "repo:tag" docker image tags from a given docker image archive (tarball) path compatible with all known specs: https://github.com/moby/moby/blob/master/image/spec/v1.md https://github.com/moby/moby/blob/master/image/spec/v1.1.md https://github.com/moby/moby/blob/master/image/spec/v1.2.md
func ImageInspect ¶
ImageInspect return low-level information on containers images
func SplitImage ¶
SplitImage splits an image into (registry,tag) following these cases:
alpine -> (alpine, latest) alpine:latest -> (alpine, latest) alpine@sha256:28ef97b8686a0b5399129e9b763d5b7e5ff03576aa5580d6f4182a49c5fe1913 -> (alpine, latest@sha256:28ef97b8686a0b5399129e9b763d5b7e5ff03576aa5580d6f4182a49c5fe1913) alpine:latest@sha256:28ef97b8686a0b5399129e9b763d5b7e5ff03576aa5580d6f4182a49c5fe1913 -> (alpine, latest@sha256:28ef97b8686a0b5399129e9b763d5b7e5ff03576aa5580d6f4182a49c5fe1913)
NOTE: for our purposes we consider the sha to be part of the tag, and we resolve the implicit :latest
Types ¶
This section is empty.