Documentation
¶
Overview ¶
Package daemon provides facilities for reading/writing v1.Image from/to a running daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Image ¶
Image provides access to an image reference from the Docker daemon, applying functional options to the underlying imageOpener before resolving the reference into a v1.Image.
Types ¶
type Client ¶
type Client interface {
Ping(ctx context.Context, options client.PingOptions) (client.PingResult, error)
ImageSave(ctx context.Context, images []string, _ ...client.ImageSaveOption) (client.ImageSaveResult, error)
ImageLoad(ctx context.Context, input io.Reader, _ ...client.ImageLoadOption) (client.ImageLoadResult, error)
ImageTag(ctx context.Context, options client.ImageTagOptions) (client.ImageTagResult, error)
ImageInspect(ctx context.Context, image string, _ ...client.ImageInspectOption) (client.ImageInspectResult, error)
ImageHistory(ctx context.Context, image string, _ ...client.ImageHistoryOption) (client.ImageHistoryResult, error)
}
Client represents the subset of a docker client that the daemon package uses.
type ImageOption ¶
type ImageOption Option
ImageOption is an alias for Option. Deprecated: Use Option instead.
type Option ¶ added in v0.5.0
type Option func(*options)
Option is a functional option for daemon operations.
func WithBufferedOpener ¶
func WithBufferedOpener() Option
WithBufferedOpener buffers the entire image into memory.
func WithClient ¶
WithClient is a functional option to allow injecting a docker client.
By default, github.com/docker/docker/client.FromEnv is used.
func WithContext ¶ added in v0.5.0
WithContext is a functional option to pass through a context.Context.
By default, context.Background() is used.
func WithFileBufferedOpener ¶ added in v0.21.1
func WithFileBufferedOpener() Option
WithFileBufferedOpener buffers the image to a temporary file on disk. This avoids holding the entire image in memory while still only performing a single image save. The temporary file is cleaned up via runtime.AddCleanup on the imageOpener.
func WithUnbufferedOpener ¶
func WithUnbufferedOpener() Option
WithUnbufferedOpener streams the image to avoid buffering it. Each access triggers a new image save.