Documentation ¶
Index ¶
- Variables
- type Graph
- func (graph *Graph) ByParent() map[string][]*image.Image
- func (graph *Graph) CheckDepth(img *image.Image) error
- func (graph *Graph) Create(layerData io.Reader, containerID, containerImage, comment, author string, ...) (*image.Image, error)
- func (graph *Graph) Delete(name string) error
- func (graph *Graph) Exists(id string) bool
- func (graph *Graph) Get(name string) (*image.Image, error)
- func (graph *Graph) GetParent(img *image.Image) (*image.Image, error)
- func (graph *Graph) HasChildren(imgID string) bool
- func (graph *Graph) IsHeld(layerID string) bool
- func (graph *Graph) IsNotExist(err error, id string) bool
- func (graph *Graph) Map() map[string]*image.Image
- func (graph *Graph) Register(im image.Descriptor, layerData io.Reader) (err error)
- func (graph *Graph) Release(sessionID string, layerIDs ...string)
- func (graph *Graph) Retain(sessionID string, layerIDs ...string)
- type ImagePullConfig
- type ImagePushConfig
- type TagStore
- func (store *TagStore) ByID() map[string][]string
- func (store *TagStore) Delete(repoName, ref string) (bool, error)
- func (store *TagStore) GetID(name string) (string, error)
- func (store *TagStore) HasReferences(img *image.Image) bool
- func (s *TagStore) History(name string) ([]*types.ImageHistory, error)
- func (s *TagStore) ImageExport(names []string, outStream io.Writer) error
- func (s *TagStore) Images(filterArgs, filter string, all bool) ([]*types.Image, error)
- func (s *TagStore) Import(src string, repo string, tag string, msg string, inConfig io.ReadCloser, ...) error
- func (s *TagStore) Load(inTar io.ReadCloser, outStream io.Writer) error
- func (s *TagStore) Lookup(name string) (*types.ImageInspect, error)
- func (store *TagStore) LookupImage(name string) (*image.Image, error)
- func (s *TagStore) Pull(image string, tag string, imagePullConfig *ImagePullConfig) error
- func (s *TagStore) Push(localName string, imagePushConfig *ImagePushConfig) error
- func (store *TagStore) Tag(repoName, tag, imageName string, force bool) error
- type TagStoreConfig
Constants ¶
This section is empty.
Variables ¶
var ErrNameIsNotExist = errors.New("image with specified name does not exist")
ErrNameIsNotExist returned when there is no image with requested name.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
A Graph is a store for versioned filesystem images and the relationship between them.
func NewGraph ¶
func NewGraph(root string, driver graphdriver.Driver, uidMaps, gidMaps []idtools.IDMap) (*Graph, error)
NewGraph instantiates a new graph at the given root path in the filesystem. `root` will be created if it doesn't exist.
func (*Graph) ByParent ¶
ByParent returns a lookup table of images by their parent. If an image of key ID has 3 children images, then the value for key ID will be a list of 3 images. If an image has no children, it will not have an entry in the table.
func (*Graph) CheckDepth ¶
CheckDepth returns an error if the depth of an image, as returned by ImageDepth, is too large to support creating a container from it on this daemon.
func (*Graph) Create ¶
func (graph *Graph) Create(layerData io.Reader, containerID, containerImage, comment, author string, containerConfig, config *runconfig.Config) (*image.Image, error)
Create creates a new image and registers it in the graph.
func (*Graph) Exists ¶
Exists returns true if an image is registered at the given id. If the image doesn't exist or if an error is encountered, false is returned.
func (*Graph) Get ¶
Get returns the image with the given id, or an error if the image doesn't exist.
func (*Graph) HasChildren ¶
HasChildren returns whether the given image has any child images.
func (*Graph) IsHeld ¶
IsHeld returns whether the given layerID is being used by an ongoing pull or build.
func (*Graph) IsNotExist ¶
IsNotExist detects whether an image exists by parsing the incoming error message.
func (*Graph) Register ¶
Register imports a pre-existing image into the graph. Returns nil if the image is already registered.
type ImagePullConfig ¶
type ImagePullConfig struct { // MetaHeaders stores HTTP headers with metadata about the image // (DockerHeaders with prefix X-Meta- in the request). MetaHeaders map[string][]string // AuthConfig holds authentication credentials for authenticating with // the registry. AuthConfig *cliconfig.AuthConfig // OutStream is the output writer for showing the status of the pull // operation. OutStream io.Writer }
ImagePullConfig stores pull configuration.
type ImagePushConfig ¶
type ImagePushConfig struct { // MetaHeaders store HTTP headers with metadata about the image // (DockerHeaders with prefix X-Meta- in the request). MetaHeaders map[string][]string // AuthConfig holds authentication credentials for authenticating with // the registry. AuthConfig *cliconfig.AuthConfig // Tag is the specific variant of the image to be pushed. // If no tag is provided, all tags will be pushed. Tag string // OutStream is the output writer for showing the status of the push // operation. OutStream io.Writer }
ImagePushConfig stores push configuration.
type TagStore ¶
type TagStore struct { // Repositories is a map of repositories, indexed by name. Repositories map[string]repository sync.Mutex // contains filtered or unexported fields }
TagStore manages repositories. It encompasses the Graph used for versioned storage, as well as various services involved in pushing and pulling repositories.
func NewTagStore ¶
func NewTagStore(path string, cfg *TagStoreConfig) (*TagStore, error)
NewTagStore creates a new TagStore at specified path, using the parameters and services provided in cfg.
func (*TagStore) ByID ¶
ByID returns a reverse-lookup table of all the names which refer to each image - e.g. {"43b5f19b10584": {"base:latest", "base:v1"}}
func (*TagStore) Delete ¶
Delete deletes a repository or a specific tag. If ref is empty, the entire repository named repoName will be deleted; otherwise only the tag named by ref will be deleted.
func (*TagStore) HasReferences ¶
HasReferences returns whether or not the given image is referenced in one or more repositories.
func (*TagStore) History ¶
func (s *TagStore) History(name string) ([]*types.ImageHistory, error)
History returns a slice of ImageHistory structures for the specified image name by walking the image lineage.
func (*TagStore) ImageExport ¶
ImageExport exports list of images to a output stream specified in the config. The exported images are archived into a tar when written to the output stream. All images with the given tag and all versions containing the same tag are exported. names is the set of tags to export, and outStream is the writer which the images are written to.
func (*TagStore) Images ¶
Images returns a filtered list of images. filterArgs is a JSON-encoded set of filter arguments which will be interpreted by pkg/parsers/filters. filter is a shell glob string applied to repository names. The argument named all controls whether all images in the graph are filtered, or just the heads.
func (*TagStore) Import ¶
func (s *TagStore) Import(src string, repo string, tag string, msg string, inConfig io.ReadCloser, outStream io.Writer, containerConfig *runconfig.Config) error
Import imports an image, getting the archived layer data either from inConfig (if src is "-"), or from a URI specified in src. Progress output is written to outStream. Repository and tag names can optionally be given in the repo and tag arguments, respectively.
func (*TagStore) Load ¶
Load uploads a set of images into the repository. This is the complementary of ImageExport. The input stream is an uncompressed tar ball containing images and metadata.
func (*TagStore) Lookup ¶
func (s *TagStore) Lookup(name string) (*types.ImageInspect, error)
Lookup looks up an image by name in a TagStore and returns it as an ImageInspect structure.
func (*TagStore) LookupImage ¶
LookupImage returns pointer to an Image struct corresponding to the given name. The name can include an optional tag; otherwise the default tag will be used.
func (*TagStore) Pull ¶
func (s *TagStore) Pull(image string, tag string, imagePullConfig *ImagePullConfig) error
Pull initiates a pull operation. image is the repository name to pull, and tag may be either empty, or indicate a specific tag to pull.
type TagStoreConfig ¶
type TagStoreConfig struct { // Graph is the versioned image store Graph *Graph // Key is the private key to use for signing manifests. Key libtrust.PrivateKey // Registry is the registry service to use for TLS configuration and // endpoint lookup. Registry *registry.Service // Events is the events service to use for logging. Events *events.Events }
TagStoreConfig provides parameters for a new TagStore.