docker

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

View Source
const (
	DefaultSocket   = "unix:///var/run/docker.sock"
	DefaultRegistry = "https://index.docker.io/v1/"
	Latest          = "latest"
	MaxLayers       = 127 - 2
)

Variables

This section is empty.

Functions

func IsImageNotFound

func IsImageNotFound(err error) bool

IsImageNotFound parses an err to determine whether the image is not found

Types

type Docker

type Docker interface {
	FindImage(image string) (*dockerclient.Image, error)
	SaveImages(images []string, writer io.Writer) error
	LoadImage(reader io.Reader) error
	PushImage(image string) error
	PullImage(image string) error
	TagImage(oldImage, newImage string) error
	RemoveImage(image string) error
	FindContainer(ctr string) (*dockerclient.Container, error)
	CommitContainer(ctr, image string) (*dockerclient.Image, error)
	GetImageHash(image string) (string, error)
	GetContainerStats(containerID string, timeout time.Duration) (*dockerclient.Stats, error)
	FindImageByHash(imageHash string, checkAllLayers bool) (*dockerclient.Image, error)
	GetImagePullSize(images []string) (uint64, error)
}

Docker is the docker client for the dfs

type DockerClient

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

func NewDockerClient

func NewDockerClient() (*DockerClient, error)

func (*DockerClient) CommitContainer

func (d *DockerClient) CommitContainer(ctr string, image string) (*dockerclient.Image, error)

func (*DockerClient) FindContainer

func (d *DockerClient) FindContainer(ctr string) (*dockerclient.Container, error)

func (*DockerClient) FindImage

func (d *DockerClient) FindImage(image string) (*dockerclient.Image, error)

func (*DockerClient) FindImageByHash

func (d *DockerClient) FindImageByHash(imageHash string, checkAllLayers bool) (*dockerclient.Image, error)

FindImageByHash searches all local images for an image with the given hash

func (*DockerClient) GetContainerStats

func (d *DockerClient) GetContainerStats(containerID string, timeout time.Duration) (*dockerclient.Stats, error)

func (*DockerClient) GetImageHash

func (d *DockerClient) GetImageHash(image string) (string, error)

Generates a unique hash of an image, based on the creation time and command of each layer. CC-1750: the hash does NOT include the layer size because during HA testing we ran into

an edge case where 2 copies of the same image on different machines had different
layer sizes.

func (*DockerClient) GetImagePullSize

func (d *DockerClient) GetImagePullSize(images []string) (uint64, error)

func (*DockerClient) LoadImage

func (d *DockerClient) LoadImage(reader io.Reader) error

func (*DockerClient) PullImage

func (d *DockerClient) PullImage(image string) error

func (*DockerClient) PushImage

func (d *DockerClient) PushImage(image string) error

func (*DockerClient) RemoveImage

func (d *DockerClient) RemoveImage(image string) error

func (*DockerClient) SaveImages

func (d *DockerClient) SaveImages(images []string, writer io.Writer) error

func (*DockerClient) TagImage

func (d *DockerClient) TagImage(oldImage, newImage string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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