docker

package
v1.375.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerImageNameFromImage added in v1.198.0

func ContainerImageNameFromImage(fullImage string) (string, error)

ContainerImageNameFromImage returns the image name of a given docker reference

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

func CreateDockerConfigJSON added in v1.177.0

func CreateDockerConfigJSON(registryURL, username, password, targetPath, configPath string, utils piperutils.FileUtils) (string, error)

CreateDockerConfigJSON creates / updates a Docker config.json with registry credentials

func ImageListWithFilePath added in v1.194.0

func ImageListWithFilePath(imageName string, excludes []string, trimDir string, utils piperutils.FileUtils) (map[string]string, error)

ImageListWithFilePath compiles container image names based on all Dockerfiles found, considering excludes according to following search pattern: **/Dockerfile* Return value contains a map with image names and file path Examples for image names with imageName testImage * Dockerfile: `imageName` * sub1/Dockerfile: `imageName-sub1` * sub2/Dockerfile_proxy: `imageName-sub2-proxy`

func IsBinfmtMiscSupportedByHost added in v1.195.0

func IsBinfmtMiscSupportedByHost(utils piperutils.FileUtils) (bool, error)

IsBinfmtMiscSupportedByHost checks if the hosts kernel does support binfmt_misc

func MergeDockerConfigJSON added in v1.298.0

func MergeDockerConfigJSON(sourcePath, targetPath string, utils piperutils.FileUtils) error

MergeDockerConfigJSON merges two docker config.json files.

Types

type AuthEntry added in v1.177.0

type AuthEntry struct {
	Auth string `json:"auth,omitempty"`
}

AuthEntry defines base64 encoded username:password required inside a Docker config.json

type Client

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

Client defines an docker client object

func (*Client) DownloadImage added in v1.207.0

func (c *Client) DownloadImage(imageSource, targetFile string) (v1.Image, error)

DownloadImage downloads the image and saves it as tar at the given path

func (*Client) DownloadImageContent added in v1.207.0

func (c *Client) DownloadImageContent(imageSource, targetDir string) (v1.Image, error)

DownloadImageContent downloads the image content into the given targetDir. Returns with an error if the targetDir doesnt exist

func (*Client) GetRemoteImageInfo added in v1.212.0

func (c *Client) GetRemoteImageInfo(imageSource string) (v1.Image, error)

GetRemoteImageInfo retrieves information about the image (e.g. digest) without actually downoading it

func (*Client) SetOptions

func (c *Client) SetOptions(options ClientOptions)

SetOptions sets options used for the docker client

type ClientOptions

type ClientOptions struct {
	ImageName   string
	RegistryURL string
	LocalPath   string
	ImageFormat string
}

ClientOptions defines the options to be set on the client

type CraneUtilsBundle added in v1.326.0

type CraneUtilsBundle struct{}

func (*CraneUtilsBundle) CopyImage added in v1.326.0

func (c *CraneUtilsBundle) CopyImage(ctx context.Context, src, dest, platform string) error

func (*CraneUtilsBundle) LoadImage added in v1.326.0

func (c *CraneUtilsBundle) LoadImage(ctx context.Context, src string) (v1.Image, error)

func (*CraneUtilsBundle) PushImage added in v1.326.0

func (c *CraneUtilsBundle) PushImage(ctx context.Context, im v1.Image, dest, platform string) error

type Download

type Download interface {
	DownloadImage(imageSource, targetFile string) (v1.Image, error)
	DownloadImageContent(imageSource, targetDir string) (v1.Image, error)
	GetRemoteImageInfo(string) (v1.Image, error)
}

Download interface for download an image to a local path

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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