docker

package
v1.132.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerImageNameTagFromImage added in v1.94.0

func ContainerImageNameTagFromImage(fullImage string) (string, error)

ContainerImageNameTagFromImage provides the name & tag part of a full image name

func ContainerRegistryFromImage added in v1.94.0

func ContainerRegistryFromImage(fullImage string) (string, error)

ContainerRegistryFromImage provides the registry part of a full image name

func ContainerRegistryFromURL added in v1.94.0

func ContainerRegistryFromURL(registryURL string) (string, error)

ContainerRegistryFromURL provides the registry part of a complete registry url including the port

Types

type Client

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

Client defines an docker client object

func (*Client) DownloadImageToPath

func (c *Client) DownloadImageToPath(imageSource, filePath string) (pkgutil.Image, error)

DownloadImageToPath download the image to the specified path

func (*Client) GetImageSource

func (c *Client) GetImageSource() (string, error)

GetImageSource get the image source from client attributes (localPath, imageName, registryURL)

func (*Client) SetOptions

func (c *Client) SetOptions(options ClientOptions)

SetOptions sets options used for the docker client

func (*Client) TarImage

func (c *Client) TarImage(writer io.Writer, image pkgutil.Image) error

TarImage write a tar from the given image

type ClientOptions

type ClientOptions struct {
	ImageName     string
	RegistryURL   string
	LocalPath     string
	IncludeLayers bool
}

ClientOptions defines the options to be set on the client

type Download

type Download interface {
	GetImageSource() (string, error)
	DownloadImageToPath(imageSource, filePath string) (pkgutil.Image, error)
	TarImage(writer io.Writer, image pkgutil.Image) error
}

Download interface for download an image to a local path

Jump to

Keyboard shortcuts

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