Documentation
¶
Overview ¶
Package cache has code for downloading and caching container images, in such a way that each can be used as overlay filesystems.
Container images come as a set of layers as gzipped tarballs, and a manifest, which lists the layers by name. The name of a layer is its (SHA256) digest.
Since layers are content-addressed and can be shared between images, the layers from all images are lumped together into a directory.
Manifests are stored in a file named for its digest; tags are symlinked to the "real" file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a base directory for an image cache
func New ¶
New constructs an instance of Cache given a cache directory. Usually the cache directory would be obtained with `os.UserCacheDir()`.
func (*Cache) Download ¶
Download makes sure the manifest and layers for a particular image are present in the cache.
func (*Cache) EnsureImage ¶
func (cache *Cache) EnsureImage(image string) (vfs.FileSystem, error)
EnsureImage constructs a filesystem for a given image, downloading it if necessary.
func (*Cache) FileSystemForImage ¶
FileSystemForImage takes an image name and ref (tag), and constructs a vfs.FileSystem from the image's layers as found in the cache. It assumes the manifest and layers will be present in the cache.