Documentation ¶
Index ¶
- Variables
- func ConfigRegistry(name string, insecure bool, mirror string)
- func NewRegitry(registry, name, passwd string) (*hreg.Registry, error)
- func SortFiles4Layer(fileList []string) []string
- func TarLayer(out io.Writer, root string, fileList []string) error
- func TarLayerAndDigest(out io.Writer, root string, fileList []string) (digest.Digest, error)
- func TarLayerDirectory(out io.Writer, root string, ignores ...string) (digest.Digest, error)
- func UntarLayer(in io.Reader) (*tar.Reader, error)
- func UntarLayerDirectory(in io.Reader, root string) error
- type DockerImage
- func (img DockerImage) Connect() (*Repository, string, error)
- func (img DockerImage) IsFromHub() bool
- func (img DockerImage) Split() (string, string, string)
- func (img DockerImage) SplitRegistry() (string, DockerImage)
- func (img DockerImage) SplitTag() (DockerImage, string)
- func (img DockerImage) ToRepository() (string, bool)
- type RegistryConfig
- type Repository
- func (r *Repository) GetLayer(digest digest.Digest, content io.Writer) error
- func (r *Repository) GetLayer2Directory(digest digest.Digest, root string) error
- func (r *Repository) GetManifest(tag string) (*manifestV1.Manifest, error)
- func (r *Repository) HasLayer(digest digest.Digest) (bool, error)
- func (r *Repository) PostLayerDirectory(root string, ignores ...string) (digest.Digest, error)
- func (r *Repository) PutLayer(digest digest.Digest, content io.Reader) error
- func (r *Repository) PutManifest(tag string, manifest *manifestV1.Manifest) error
Constants ¶
This section is empty.
Variables ¶
var ( DefaultRegistry = "registry-1.docker.io" QuayRegistry = "quay.io" GoogleRegistry = "gcr.io" LocalhostRegistry = "localhost:5000" LocalComposeRegistry = "registry.local:5000" )
Functions ¶
func ConfigRegistry ¶
ConfigRegistry config a docker registry
func SortFiles4Layer ¶
SortFiles4Layer sort file list for layer
func TarLayerAndDigest ¶
TarLayerAndDigest tar a new layer and return its digest
func TarLayerDirectory ¶
TarLayerDirectory tar the whole directory to a layer
func UntarLayer ¶
UntarLayer untar a layer to tar.Reader
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 ¶
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