docker

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShaIdent string = "@sha256:"
	Ext      string = ".docker.tar"
)

Variables

This section is empty.

Functions

func FilePathToImageName

func FilePathToImageName(fileName string) (imageName string, err error)

FileNameToImageName converts an archived file name back to the origonal docker image name

func GetAuth

func GetAuth(image string) string

GetAuth loads config for a given registry from the Docker config file

func GetAuthString added in v0.3.8

func GetAuthString(image, username, password string) (string, error)

GetAuthString will return a valid auth string from credentials

func GetClientRepoDigests added in v1.0.2

func GetClientRepoDigests(imageID string) ([]string, error)

func GetClientRepoDigestsByRegistry added in v1.0.2

func GetClientRepoDigestsByRegistry(imageID string, registry string) ([]string, error)

func GetImageTag added in v1.0.1

func GetImageTag(image string) string

func GetNewImageName added in v0.3.3

func GetNewImageName(image string, registry string) string

func GetRepoDigest added in v1.0.1

func GetRepoDigest(image string) string

func ImageToFilePath

func ImageToFilePath(imageName string, dir string) (fileName string, err error)

ImageToFileName provides an archived name from a docker image name

func IsClientErrNotFound added in v1.0.2

func IsClientErrNotFound(err error) bool

func Load

func Load(image *Image) error

Load a container from archive and return the image name

func Push

func Push(image string, creds *util.Creds) error

Push will push a docker image

func ReTag

func ReTag(image *Image) error

func Save

func Save(c *hashcache.CheckSumCache, image string, dir string, creds *util.Creds) error

Save will save a docker image

func StripImageTag added in v1.0.1

func StripImageTag(image string) string

func StripRepoDigest added in v1.0.1

func StripRepoDigest(image string) string

func ValidatePublishedRepoDigestMatchesHashcache added in v1.0.2

func ValidatePublishedRepoDigestMatchesHashcache(image Image) (bool, error)

Check if the docker recorded RepoDigest matches Image struct RepoDigest

Types

type Image

type Image struct {
	FileName     string
	ImageID      string
	ImageName    string
	ImageTag     string
	NewImageName string
	RepoDigest   string
}

func GetImages

func GetImages(files []string, registry string) ([]Image, error)

GetImages retrieves an image struct array

func NewImageFromFilePath added in v1.0.1

func NewImageFromFilePath(file string, registry string) (Image, error)

type PushEvent

type PushEvent struct {
	Status         string `json:"status"`
	Error          string `json:"error"`
	Progress       string `json:"progress"`
	ProgressDetail struct {
		Current int `json:"current"`
		Total   int `json:"total"`
	} `json:"progressDetail"`
	Id string `json:"id"`
}

type SaveEvent

type SaveEvent struct {
	Status         string `json:"status"`
	Error          string `json:"error"`
	Progress       string `json:"progress"`
	ProgressDetail struct {
		Current int `json:"current"`
		Total   int `json:"total"`
	} `json:"progressDetail"`
	Id string `json:"id"`
}

Jump to

Keyboard shortcuts

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