Documentation ¶
Index ¶
- func GetRepository(ctx context.Context, ref reference.Named, config *ImagePullConfig) (repository distribution.Repository, lastError error)
- func Pull(ctx context.Context, ref reference.Named, config *ImagePullConfig, ...) error
- func Push(ctx context.Context, ref reference.Named, config *ImagePushConfig) error
- type Config
- type ContentStore
- type ImageConfigStore
- type ImagePullConfig
- type ImagePushConfig
- type PushLayer
- type PushLayerProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRepository ¶
func GetRepository(ctx context.Context, ref reference.Named, config *ImagePullConfig) (repository distribution.Repository, lastError error)
GetRepository returns a repository from the registry.
func Pull ¶
func Pull(ctx context.Context, ref reference.Named, config *ImagePullConfig, local ContentStore) 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.
Types ¶
type Config ¶ added in v1.13.0
type Config struct { // MetaHeaders stores HTTP headers with metadata about the image MetaHeaders map[string][]string // AuthConfig holds authentication credentials for authenticating with // the registry. AuthConfig *types.AuthConfig // ProgressOutput is the interface for showing the status of the pull // operation. ProgressOutput progress.Output // RegistryService is the registry service to use for TLS configuration // and endpoint lookup. RegistryService registry.Service // ImageEventLogger notifies events for a given image ImageEventLogger func(id, name, action string) // MetadataStore is the storage backend for distribution-specific // metadata. MetadataStore metadata.Store // ImageStore manages images. ImageStore ImageConfigStore // ReferenceStore manages tags. This value is optional, when excluded // content will not be tagged. ReferenceStore refstore.Store // RequireSchema2 ensures that only schema2 manifests are used. RequireSchema2 bool }
Config stores configuration for communicating with a registry.
type ContentStore ¶
type ContentStore interface { content.Ingester content.Provider Info(ctx context.Context, dgst digest.Digest) (content.Info, error) Abort(ctx context.Context, ref string) error Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error) }
ContentStore is the interface used to persist registry blobs
Currently this is only used to persist manifests and manifest lists. It is exported because `distribution.Pull` takes one as an argument.
type ImageConfigStore ¶ added in v1.13.0
type ImageConfigStore interface { Put(context.Context, []byte) (digest.Digest, error) Get(context.Context, digest.Digest) ([]byte, error) }
ImageConfigStore handles storing and getting image configurations by digest. Allows getting an image configurations rootfs from the configuration.
func NewImageConfigStoreFromStore ¶ added in v1.13.0
func NewImageConfigStoreFromStore(is image.Store) ImageConfigStore
NewImageConfigStoreFromStore returns an ImageConfigStore backed by an image.Store for container images.
type ImagePullConfig ¶
type ImagePullConfig struct { Config // DownloadManager manages concurrent pulls. DownloadManager *xfer.LayerDownloadManager // Schema2Types is an optional list of valid schema2 configuration types // allowed by the pull operation. If omitted, the default list of accepted // types is used. Schema2Types []string // Platform is the requested platform of the image being pulled Platform *specs.Platform }
ImagePullConfig stores pull configuration.
type ImagePushConfig ¶
type ImagePushConfig struct { Config // ConfigMediaType is the configuration media type for // schema2 manifests. ConfigMediaType string // LayerStores manages layers. LayerStores PushLayerProvider // TrustKey is the private key for legacy signatures. This is typically // an ephemeral key, since these signatures are no longer verified. TrustKey libtrust.PrivateKey // UploadManager dispatches uploads. UploadManager *xfer.LayerUploadManager }
ImagePushConfig stores push configuration.
type PushLayer ¶ added in v1.13.0
type PushLayer interface { ChainID() layer.ChainID DiffID() layer.DiffID Parent() PushLayer Open() (io.ReadCloser, error) Size() int64 MediaType() string Release() }
PushLayer is a pushable layer with metadata about the layer and access to the content of the layer.
type PushLayerProvider ¶ added in v1.13.0
PushLayerProvider provides layers to be pushed by ChainID.
func NewLayerProvidersFromStore ¶
func NewLayerProvidersFromStore(ls layer.Store) PushLayerProvider
NewLayerProvidersFromStore returns layer providers backed by an instance of LayerStore. Only getting layers as gzipped tars is supported.