Documentation
¶
Overview ¶
Package daemon wires the engine together: the image store, the root filesystems built from it, and the container manager. The API server is a thin HTTP face over it.
Index ¶
- Variables
- func ExecConfig(img *image.Image) image.ExecConfig
- type CreateRequest
- type Daemon
- func (d *Daemon) Close(ctx context.Context) error
- func (d *Daemon) Containers() *container.Manager
- func (d *Daemon) CreateContainer(req CreateRequest) (*container.Container, error)
- func (d *Daemon) Images() ([]ImageInfo, error)
- func (d *Daemon) Pull(ctx context.Context, ref string, progress image.Progress) (string, *image.PullResult, error)
- func (d *Daemon) RemoveImage(ref string, force bool) ([]DeleteItem, error)
- func (d *Daemon) ResolveImage(ref string) (string, *image.Image, error)
- type DeleteItem
- type ImageInfo
- type Options
Constants ¶
This section is empty.
Variables ¶
var ErrImageInUse = errors.New("image is being used by a container")
ErrImageInUse is returned when removing an image a container uses.
var ErrNoSuchImage = errors.New("no such image")
ErrNoSuchImage is returned for an unknown image reference.
Functions ¶
func ExecConfig ¶
func ExecConfig(img *image.Image) image.ExecConfig
ExecConfig returns the run configuration an image declares. A wasm artifact has none; its single module is the entrypoint.
Types ¶
type CreateRequest ¶
type CreateRequest struct {
Name string
Image string
Entrypoint []string // nil = image's
Cmd []string // nil = image's
Env []string
WorkingDir string
Labels map[string]string
Memory int64
AutoRemove bool
}
CreateRequest is a container create, with Docker's override rules: a set Entrypoint replaces the image's and drops its Cmd; a set Cmd replaces the image's Cmd; Env entries override the image's by key.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is one engine instance.
func (*Daemon) Containers ¶
Containers is the container manager.
func (*Daemon) CreateContainer ¶
func (d *Daemon) CreateContainer(req CreateRequest) (*container.Container, error)
CreateContainer makes a container from an image.
func (*Daemon) Pull ¶
func (d *Daemon) Pull(ctx context.Context, ref string, progress image.Progress) (string, *image.PullResult, error)
Pull fetches ref and names it; it returns the local name.
func (*Daemon) RemoveImage ¶
func (d *Daemon) RemoveImage(ref string, force bool) ([]DeleteItem, error)
RemoveImage untags ref (or every name of an image given by ID) and deletes the image's blobs once no name is left. An image a container uses is refused unless force.
type DeleteItem ¶
DeleteItem is one line of an image removal.
type ImageInfo ¶
type ImageInfo struct {
ID image.Digest
RepoTags []string
RepoDigests []string
Created time.Time
Size int64
Labels map[string]string
Containers int
Image *image.Image
}
ImageInfo is one image as `docker images` lists it.
type Options ¶
type Options struct {
// Root holds the image store on disk. One of Root and Backend is
// required.
Root string
// Backend holds the image store elsewhere (memory, IndexedDB).
Backend image.Backend
// Limits bound pulls; zero means image.DefaultLimits.
Limits image.Limits
// Unpack bounds layer unpacking; zero means rootfs.DefaultLimits.
Unpack rootfs.Limits
// Registry configures registry pulls.
Registry image.RegistryOptions
// Containers configures the container manager (Executor required).
Containers container.Options
// MaxLowers bounds how many unpacked image trees stay in memory.
MaxLowers int
}
Options configures a daemon.