docker

package
v0.0.0-...-df0e9fc Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPlatform string = "linux/amd64"

Variables

This section is empty.

Functions

func SplitDockerImage

func SplitDockerImage(fullImg string) (name string, tag string)

SplitDockerImage splits the image into the name and tag. If the image does not have a tag or is invalid, the full string is returned as name, and tag will be empty.

Types

type ContainerImage

type ContainerImage struct {
	// The registry name
	Registry string `json:"registry,omitempty"`
	// The repository name or path
	Repository string `json:"repository,omitempty"`
	// The tag
	Tag string `json:"tag,omitempty"`
}

ContainerImage represents a container image and its components

func ParseContainerImage

func ParseContainerImage(image string) (*ContainerImage, error)

func (*ContainerImage) Local

func (ci *ContainerImage) Local() string

Local returns the local image name without registry

func (*ContainerImage) Remote

func (ci *ContainerImage) Remote() string

Remote returns the remote image name with registry when specified

type Docker

type Docker interface {
	tools.ExternalTool
	Login(ctx context.Context, loginServer string, username string, password string) error
	Build(
		ctx context.Context,
		cwd string,
		dockerFilePath string,
		platform string,
		target string,
		buildContext string,
		name string,
		buildArgs []string,
		buildProgress io.Writer,
	) (string, error)
	Tag(ctx context.Context, cwd string, imageName string, tag string) error
	Push(ctx context.Context, cwd string, tag string) error
	Pull(ctx context.Context, imageName string) error
	Inspect(ctx context.Context, imageName string, format string) (string, error)
}

func NewDocker

func NewDocker(commandRunner exec.CommandRunner) Docker

Jump to

Keyboard shortcuts

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