registry

package
v0.0.0-...-049616f Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2017 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRegistry      = "registry-1.docker.io"
	QuayRegistry         = "quay.io"
	GoogleRegistry       = "gcr.io"
	LocalhostRegistry    = "localhost:5000"
	LocalComposeRegistry = "registry.local:5000"
)

Functions

func ConfigRegistry

func ConfigRegistry(name string, insecure bool, mirror string)

ConfigRegistry config a docker registry

func NewRegitry

func NewRegitry(registry, name, passwd string) (*hreg.Registry, error)

Deprecated

func SortFiles4Layer

func SortFiles4Layer(fileList []string) []string

SortFiles4Layer sort file list for layer

func TarLayer

func TarLayer(out io.Writer, root string, fileList []string) error

TarLayer tar a docker image layer

func TarLayerAndDigest

func TarLayerAndDigest(
	out io.Writer, root string, fileList []string) (digest.Digest, error)

TarLayerAndDigest tar a new layer and return its digest

func TarLayerDirectory

func TarLayerDirectory(
	out io.Writer, root string, ignores ...string) (digest.Digest, error)

TarLayerDirectory tar the whole directory to a layer

func UntarLayer

func UntarLayer(in io.Reader) (*tar.Reader, error)

UntarLayer untar a layer to tar.Reader

func UntarLayerDirectory

func UntarLayerDirectory(in io.Reader, root string) error

UntarLayerDirectory untar a layer to directory

Types

type DockerImage

type DockerImage string

ImageName represents a docker image name

func (DockerImage) Connect

func (img DockerImage) Connect() (*Repository, string, error)

Connect connects to repository, return repo and tag from DockerImage

func (DockerImage) IsFromHub

func (img DockerImage) IsFromHub() bool

IsFromHub check if this image should be from docker hub

func (DockerImage) Split

func (img DockerImage) Split() (string, string, string)

Split splits the image whole name to registry url, repository name and image tag

func (DockerImage) SplitRegistry

func (img DockerImage) SplitRegistry() (string, DockerImage)

SplitRegistry return the registry's url which holding this image, and the rest of image name

func (DockerImage) SplitTag

func (img DockerImage) SplitTag() (DockerImage, string)

SplitTag return the rest of image name and image tag

func (DockerImage) ToRepository

func (img DockerImage) ToRepository() (string, bool)

ToRepository check if image name doesn't contain tag field, caller's reposibility to make sure registry field already been splitted

type RegistryConfig

type RegistryConfig struct {
	Name     string
	Insecure bool
	Mirror   string
}

RegistryConfig represents config information for a docker registry

func GetRegistryConfig

func GetRegistryConfig(name string) RegistryConfig

GetRegistryConfig get the config of a docker registry, and return default if doesn't exist

type Repository

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

Repository represents a docker registry repository

func ConnectRepository

func ConnectRepository(registry, repository string) (*Repository, error)

ConnectRepository get a connection to a registry's repository

func (*Repository) GetLayer

func (r *Repository) GetLayer(digest digest.Digest, content io.Writer) error

GetLayer gets the layer of image

func (*Repository) GetLayer2Directory

func (r *Repository) GetLayer2Directory(
	digest digest.Digest, root string) error

GetLayer2Directory fetching the layer and untar it

func (*Repository) GetManifest

func (r *Repository) GetManifest(tag string) (*manifestV1.Manifest, error)

GetManifest gets manifest of a tag of image

func (*Repository) HasLayer

func (r *Repository) HasLayer(digest digest.Digest) (bool, error)

HasLayer check if remote repository has specific layer

func (*Repository) PostLayerDirectory

func (r *Repository) PostLayerDirectory(
	root string, ignores ...string) (digest.Digest, error)

PutLayer4Directory put layer from directory

func (*Repository) PutLayer

func (r *Repository) PutLayer(digest digest.Digest, content io.Reader) error

PutLayer puts the layer of image

func (*Repository) PutManifest

func (r *Repository) PutManifest(
	tag string, manifest *manifestV1.Manifest) error

PutManifest puts manifest to a tag of image

Jump to

Keyboard shortcuts

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