docker

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShortImageID

func ShortImageID(imageID string) string

ShortImageID returns the short version of an image ID

func StripImageTagHost

func StripImageTagHost(imageTag string) string

StripImageTagHost strips the host from an image tag

Types

type Client

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

Client is client structure

func NewClient

func NewClient(config *Config) *Client

NewClient creates a new client instance

func (*Client) Debugf

func (c *Client) Debugf(str string, args ...interface{})

Debugf prints debug log

func (*Client) HasImage

func (c *Client) HasImage(imageID string) (bool, error)

HasImage returns true if image ID is available locally

func (*Client) ListImages

func (c *Client) ListImages() ([]*ImageSummary, error)

ListImages return list of docker images

func (*Client) LoadImage

func (c *Client) LoadImage(input io.Reader) error

LoadImage loads an image from an IO reader

func (*Client) LoadImageByFilePath

func (c *Client) LoadImageByFilePath(filepath string) error

LoadImageByFilePath loads an image from a tarball

func (*Client) PullImage

func (c *Client) PullImage(imageID string) error

PullImage pulls a docker image

func (*Client) PushImage

func (c *Client) PushImage(imageID string) error

PushImage pushes a docker image

func (*Client) ReadImage

func (c *Client) ReadImage(imageID string) (io.Reader, error)

ReadImage reads the contents of an image into an IO reader

func (*Client) RemoveAllImages

func (c *Client) RemoveAllImages() error

RemoveAllImages removes all images from the local registry

func (*Client) RemoveImage

func (c *Client) RemoveImage(imageID string) error

RemoveImage remove an image from the local registry

func (*Client) SaveImageTar

func (c *Client) SaveImageTar(imageID string, dest string) error

SaveImageTar saves an image into a tarball

func (*Client) TagImage

func (c *Client) TagImage(imageID, tag string) error

TagImage tags an image

type Config

type Config struct {
	Debug bool
}

Config is client config

type ImageSummary

type ImageSummary struct {
	ID   string
	Tags []string
	Size int64
}

ImageSummary is structure for image summary

Jump to

Keyboard shortcuts

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