Documentation
¶
Index ¶
- Constants
- func IsImageNotFound(err error) bool
- type Docker
- type DockerClient
- func (d *DockerClient) CommitContainer(ctr string, image string) (*dockerclient.Image, error)
- func (d *DockerClient) FindContainer(ctr string) (*dockerclient.Container, error)
- func (d *DockerClient) FindImage(image string) (*dockerclient.Image, error)
- func (d *DockerClient) FindImageByHash(imageHash string, checkAllLayers bool) (*dockerclient.Image, error)
- func (d *DockerClient) GetContainerStats(containerID string, timeout time.Duration) (*dockerclient.Stats, error)
- func (d *DockerClient) GetImageHash(image string) (string, error)
- func (d *DockerClient) GetImagePullSize(images []string) (uint64, error)
- func (d *DockerClient) LoadImage(reader io.Reader) error
- func (d *DockerClient) PullImage(image string) error
- func (d *DockerClient) PushImage(image string) error
- func (d *DockerClient) RemoveImage(image string) error
- func (d *DockerClient) SaveImages(images []string, writer io.Writer) error
- func (d *DockerClient) TagImage(oldImage, newImage string) error
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 ¶
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) 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
Click to show internal directories.
Click to hide internal directories.