Documentation ¶
Index ¶
- Constants
- Variables
- func NewV2Repository(repoInfo *registry.RepositoryInfo, endpoint registry.APIEndpoint, ...) (distribution.Repository, error)
- func SetupInitLayer(initLayer string) error
- func WriteStatus(requestedTag string, out io.Writer, sf *streamformatter.StreamFormatter, ...)
- type ByCreated
- type Graph
- func (graph *Graph) ByParent() map[string][]*image.Image
- func (graph *Graph) CheckDepth(img *image.Image) error
- func (graph *Graph) Create(layerData archive.ArchiveReader, ...) (*image.Image, error)
- func (graph *Graph) Delete(name string) error
- func (graph *Graph) Exists(id string) bool
- func (graph *Graph) GenerateV1CompatibilityChain(id string) ([]byte, error)
- func (graph *Graph) Get(name string) (*image.Image, error)
- func (graph *Graph) GetLayerDigest(id string) (digest.Digest, error)
- func (graph *Graph) GetParent(img *image.Image) (*image.Image, error)
- func (graph *Graph) GetParentsSize(img *image.Image, size int64) int64
- func (graph *Graph) GetV1CompatibilityConfig(id string) ([]byte, error)
- func (graph *Graph) Heads() map[string]*image.Image
- 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) RawJSON(id string) ([]byte, error)
- func (graph *Graph) Register(im image.ImageDescriptor, layerData archive.ArchiveReader) (err error)
- func (graph *Graph) Release(sessionID string, layerIDs ...string)
- func (graph *Graph) Retain(sessionID string, layerIDs ...string)
- func (graph *Graph) SetLayerDigest(id string, dgst digest.Digest) error
- func (graph *Graph) SetV1CompatibilityConfig(id string, data []byte) error
- func (graph *Graph) TarLayer(img *image.Image) (arch archive.Archive, err error)
- func (graph *Graph) TempLayerArchive(id string, sf *streamformatter.StreamFormatter, output io.Writer) (*archive.TempArchive, error)
- func (graph *Graph) WalkHistory(img *image.Image, handler func(image.Image) error) (err error)
- type ImageExportConfig
- type ImageImportConfig
- type ImagePullConfig
- type ImagePushConfig
- type ImagesConfig
- type Puller
- type Pusher
- type Repository
- type TagStore
- func (store *TagStore) ByID() map[string][]string
- func (store *TagStore) Delete(repoName, ref string) (bool, error)
- func (store *TagStore) DeleteAll(id string) error
- func (store *TagStore) Get(repoName string) (Repository, error)
- func (store *TagStore) GetImage(repoName, refOrID string) (*image.Image, error)
- func (store *TagStore) GetRepoRefs() map[string][]string
- func (s *TagStore) History(name string) ([]*types.ImageHistory, error)
- func (s *TagStore) ImageExport(imageExportConfig *ImageExportConfig) error
- func (store *TagStore) ImageName(id string) string
- func (s *TagStore) ImageTarLayer(name string, dest io.Writer) error
- func (s *TagStore) Images(config *ImagesConfig) ([]*types.Image, error)
- func (s *TagStore) Import(src string, repo string, tag string, imageImportConfig *ImageImportConfig) 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) NewPusher(endpoint registry.APIEndpoint, localRepo Repository, ...) (Pusher, error)
- func (s *TagStore) Pull(image string, tag string, imagePullConfig *ImagePullConfig) error
- func (s *TagStore) Push(localName string, imagePushConfig *ImagePushConfig) error
- func (store *TagStore) SetDigest(repoName, digest, imageName string) error
- func (store *TagStore) SetLoad(repoName, tag, imageName string, force bool, out io.Writer) error
- func (store *TagStore) Tag(repoName, tag, imageName string, force bool) error
- type TagStoreConfig
Constants ¶
const DEFAULTTAG = "latest"
const MaxImageDepth = 127
Set the max depth to the aufs default that most kernels are compiled with For more information see: http://sourceforge.net/p/aufs/aufs3-standalone/ci/aufs3.12/tree/config.mk
Variables ¶
var ( // ErrDigestNotSet is used when request the digest for a layer // but the layer has no digest value or content to compute the // the digest. ErrDigestNotSet = errors.New("digest is not set for layer") )
Functions ¶
func NewV2Repository ¶ added in v0.327.0
func NewV2Repository(repoInfo *registry.RepositoryInfo, endpoint registry.APIEndpoint, metaHeaders http.Header, authConfig *cliconfig.AuthConfig) (distribution.Repository, error)
v2 only
func SetupInitLayer ¶
setupInitLayer populates a directory with mountpoints suitable for bind-mounting dockerinit into the container. The mountpoint is simply an empty file at /.dockerinit
This extra layer is used by all containers as the top-most ro layer. It protects the container from unwanted side-effects on the rw layer.
func WriteStatus ¶
func WriteStatus(requestedTag string, out io.Writer, sf *streamformatter.StreamFormatter, layersDownloaded bool)
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) (*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 id 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 ¶ added in v0.327.0
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 archive.ArchiveReader, 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) GenerateV1CompatibilityChain ¶ added in v0.327.0
GenerateV1CompatibilityChain makes sure v1Compatibility JSON data exists for the image. If it doesn't it generates and stores it for the image and all of it's parents based on the image config JSON.
func (*Graph) Get ¶
Get returns the image with the given id, or an error if the image doesn't exist.
func (*Graph) GetLayerDigest ¶ added in v0.327.0
GetDigest gets the digest for the provide image layer id.
func (*Graph) GetParentsSize ¶ added in v0.327.0
func (*Graph) GetV1CompatibilityConfig ¶ added in v0.327.0
GetV1CompatibilityConfig reads the v1Compatibility JSON data for the image from the disk
func (*Graph) Heads ¶
Heads returns all heads in the graph, keyed by id. A head is an image which is not the parent of another image in the graph.
func (*Graph) IsHeld ¶ added in v0.327.0
IsHeld returns whether the given layerID is being used by an ongoing pull or build.
func (*Graph) IsNotExist ¶
FIXME: Implement error subclass instead of looking at the error text Note: This is the way golang implements os.IsNotExists on Plan9
func (*Graph) RawJSON ¶ added in v0.327.0
RawJSON returns the JSON representation for an image as a byte array.
func (*Graph) Register ¶
func (graph *Graph) Register(im image.ImageDescriptor, layerData archive.ArchiveReader) (err error)
Register imports a pre-existing image into the graph. Returns nil if the image is already registered.
func (*Graph) Release ¶ added in v0.327.0
Release removes the referenced image id from the provided set of layers.
func (*Graph) Retain ¶ added in v0.327.0
If the images and layers are in pulling chain, retain them. If not, they may be deleted by rmi with dangling condition.
func (*Graph) SetLayerDigest ¶ added in v0.327.0
SetDigest sets the digest for the image layer to the provided value.
func (*Graph) SetV1CompatibilityConfig ¶ added in v0.327.0
SetV1CompatibilityConfig stores the v1Compatibility JSON data associated with the image in the manifest to the disk
func (*Graph) TarLayer ¶ added in v0.327.0
TarLayer returns a tar archive of the image's filesystem layer.
func (*Graph) TempLayerArchive ¶
func (graph *Graph) TempLayerArchive(id string, sf *streamformatter.StreamFormatter, output io.Writer) (*archive.TempArchive, error)
TempLayerArchive creates a temporary archive of the given image's filesystem layer.
The archive is stored on disk and will be automatically deleted as soon as has been read. If output is not nil, a human-readable progress bar will be written to it.
type ImageExportConfig ¶
CmdImageExport exports all images with the given tag. All versions containing the same tag are exported. The resulting output is an uncompressed tar ball. name is the set of tags to export. out is the writer where the images are written to.
type ImageImportConfig ¶
type ImagePullConfig ¶
type ImagePushConfig ¶
type ImagesConfig ¶
type Puller ¶ added in v0.327.0
type Puller interface { // Pull tries to pull the image referenced by `tag` // Pull returns an error if any, as well as a boolean that determines whether to retry Pull on the next configured endpoint. // // TODO(tiborvass): have Pull() take a reference to repository + tag, so that the puller itself is repository-agnostic. Pull(tag string) (fallback bool, err error) }
func NewPuller ¶ added in v0.327.0
func NewPuller(s *TagStore, endpoint registry.APIEndpoint, repoInfo *registry.RepositoryInfo, imagePullConfig *ImagePullConfig, sf *streamformatter.StreamFormatter) (Puller, error)
type Pusher ¶ added in v0.327.0
type Pusher interface { // Push tries to push the image configured at the creation of Pusher. // Push returns an error if any, as well as a boolean that determines whether to retry Push on the next configured endpoint. // // TODO(tiborvass): have Push() take a reference to repository + tag, so that the pusher itself is repository-agnostic. Push() (fallback bool, err error) }
type Repository ¶
func (Repository) Contains ¶
func (r Repository) Contains(u Repository) bool
return true if the contents of u Repository, are wholly contained in r Repository
func (Repository) Update ¶
func (r Repository) Update(u Repository)
update Repository mapping with content of u
type TagStore ¶
type TagStore struct { Repositories map[string]Repository sync.Mutex // contains filtered or unexported fields }
func NewTagStore ¶
func NewTagStore(path string, cfg *TagStoreConfig) (*TagStore, error)
func (*TagStore) ByID ¶
Return a reverse-lookup table of all the names which refer to each image Eg. {"43b5f19b10584": {"base:latest", "base:v1"}}
func (*TagStore) GetRepoRefs ¶
func (*TagStore) ImageExport ¶
func (s *TagStore) ImageExport(imageExportConfig *ImageExportConfig) error
func (*TagStore) ImageTarLayer ¶
ImageTarLayer return the tarLayer of the image
func (*TagStore) Load ¶
Loads 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 return an image encoded in JSON
func (*TagStore) LookupImage ¶
func (*TagStore) NewPusher ¶ added in v0.327.0
func (s *TagStore) NewPusher(endpoint registry.APIEndpoint, localRepo Repository, repoInfo *registry.RepositoryInfo, imagePushConfig *ImagePushConfig, sf *streamformatter.StreamFormatter) (Pusher, error)
func (*TagStore) Pull ¶
func (s *TagStore) Pull(image string, tag string, imagePullConfig *ImagePullConfig) error
func (*TagStore) Push ¶
func (s *TagStore) Push(localName string, imagePushConfig *ImagePushConfig) error
FIXME: Allow to interrupt current push when new push of same image is done.