Documentation ¶
Overview ¶
Package daemon exposes the functions that occur on the host server that the Docker daemon is running.
In implementing the various functions of the daemon, there is often a method-specific struct for configuring the runtime behavior.
Index ¶
- Constants
- Variables
- func GetFullContainerName(name string) (string, error)
- type CommonConfig
- type CommonContainer
- type Config
- type Container
- func (container *Container) Attach(stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) chan error
- func (container *Container) Changes() ([]archive.Change, error)
- func (container *Container) Copy(resource string) (io.ReadCloser, error)
- func (container *Container) DisconnectFromNetwork(n libnetwork.Network) error
- func (container *Container) ExitOnNext()
- func (container *Container) Export() (archive.Archive, error)
- func (container *Container) Exposes(p nat.Port) bool
- func (container *Container) GetDaemon() *Daemon
- func (container *Container) GetImage() (*image.Image, error)
- func (container *Container) GetResourcePath(path string) (string, error)
- func (container *Container) HostConfig() *runconfig.HostConfig
- func (container *Container) Kill() error
- func (container *Container) KillSig(sig int) error
- func (c *Container) LogDriverType() string
- func (container *Container) Mount() error
- func (container *Container) Resize(h, w int) error
- func (container *Container) SetDaemon(daemon *Daemon)
- func (container *Container) SetHostConfig(hostConfig *runconfig.HostConfig)
- func (container *Container) StartLogger(cfg runconfig.LogConfig) (logger.Logger, error)
- func (streamConfig *Container) StderrPipe() io.ReadCloser
- func (streamConfig *Container) StdinPipe() io.WriteCloser
- func (streamConfig *Container) StdoutPipe() io.ReadCloser
- func (container *Container) Stop(seconds int) error
- func (container *Container) Unmount() error
- type ContainerCommitConfig
- type ContainerCreateConfig
- type ContainerRmConfig
- type ContainersConfig
- type Daemon
- func (daemon *Daemon) AuthenticateToRegistry(authConfig *cliconfig.AuthConfig) (string, error)
- func (daemon *Daemon) Cleanup(container *Container)
- func (daemon *Daemon) Commit(name string, c *ContainerCommitConfig) (*image.Image, error)
- func (daemon *Daemon) Config() *Config
- func (daemon *Daemon) ConnectContainerToNetwork(containerName, networkName string) error
- func (daemon *Daemon) ConnectToNetwork(container *Container, idOrName string) error
- func (daemon *Daemon) ContainerChanges(name string) ([]archive.Change, error)
- func (daemon *Daemon) ContainerCreate(params *ContainerCreateConfig) (types.ContainerCreateResponse, error)
- func (d *Daemon) ContainerExecCreate(config *runconfig.ExecConfig) (string, error)
- func (daemon *Daemon) ContainerExecInspect(id string) (*ExecConfig, error)
- func (d *Daemon) ContainerExecStart(name string, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) error
- func (daemon *Daemon) ContainerGraph() *graphdb.Database
- func (daemon *Daemon) ContainerInspect(name string, size bool) (*types.ContainerJSON, error)
- func (daemon *Daemon) ContainerInspect120(name string) (*v1p20.ContainerJSON, error)
- func (daemon *Daemon) ContainerInspectPre120(name string) (*v1p19.ContainerJSON, error)
- func (daemon *Daemon) ContainerKill(name string, sig uint64) error
- func (daemon *Daemon) ContainerPause(name string) error
- func (daemon *Daemon) ContainerRename(oldName, newName string) error
- func (daemon *Daemon) ContainerRm(name string, config *ContainerRmConfig) error
- func (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConfig) error
- func (daemon *Daemon) ContainerStop(name string, seconds int) error
- func (daemon *Daemon) ContainerUnpause(name string) error
- func (daemon *Daemon) Containers(config *ContainersConfig) ([]*types.Container, error)
- func (daemon *Daemon) CreateNetwork(name, driver string, ipam network.IPAM, options map[string]string) (libnetwork.Network, error)
- func (daemon *Daemon) DisconnectContainerFromNetwork(containerName string, network libnetwork.Network) error
- func (d *Daemon) Exec(c *Container, ExecConfig *ExecConfig, pipes *execdriver.Pipes, ...) (int, error)
- func (d *Daemon) ExecExists(name string) (bool, error)
- func (daemon *Daemon) ExecutionDriver() execdriver.Driver
- func (daemon *Daemon) Exists(id string) bool
- func (daemon *Daemon) ExportImage(names []string, outStream io.Writer) error
- func (daemon *Daemon) FindNetwork(idName string) (libnetwork.Network, error)
- func (daemon *Daemon) Get(prefixOrName string) (*Container, error)
- func (daemon *Daemon) GetByName(name string) (*Container, error)
- func (daemon *Daemon) GetContainerStats(container *Container) (*execdriver.ResourceStats, error)
- func (daemon *Daemon) GetEventFilter(filter filters.Args) *events.Filter
- func (daemon *Daemon) GetImage(name string) (*image.Image, error)
- func (daemon *Daemon) GetLabels(id string) map[string]string
- func (daemon *Daemon) GetNetwork(idName string, by int) (libnetwork.Network, error)
- func (daemon *Daemon) GetNetworkDriverList() map[string]bool
- func (daemon *Daemon) GetNetworksByID(partialID string) []libnetwork.Network
- func (daemon *Daemon) GetRemappedUIDGID() (int, int)
- func (daemon *Daemon) GetUIDGIDMaps() ([]idtools.IDMap, []idtools.IDMap)
- func (daemon *Daemon) Graph() *graph.Graph
- func (daemon *Daemon) GraphDriver() graphdriver.Driver
- func (daemon *Daemon) ImageDelete(imageRef string, force, prune bool) ([]types.ImageDelete, error)
- func (daemon *Daemon) ImageGetCached(imgID string, config *runconfig.Config) (*image.Image, error)
- func (daemon *Daemon) ImageHistory(name string) ([]*types.ImageHistory, error)
- func (daemon *Daemon) ImportImage(src, repo, tag, msg string, inConfig io.ReadCloser, outStream io.Writer, ...) error
- func (daemon *Daemon) IsShuttingDown() bool
- func (daemon *Daemon) Kill(container *Container) error
- func (daemon *Daemon) List() []*Container
- func (daemon *Daemon) ListImages(filterArgs, filter string, all bool) ([]*types.Image, error)
- func (daemon *Daemon) LoadImage(inTar io.ReadCloser, outStream io.Writer) error
- func (daemon *Daemon) LookupImage(name string) (*types.ImageInspect, error)
- func (daemon *Daemon) Mount(container *Container) error
- func (daemon *Daemon) NetworkControllerEnabled() bool
- func (daemon *Daemon) PullImage(image string, tag string, imagePullConfig *graph.ImagePullConfig) error
- func (daemon *Daemon) PushImage(localName string, imagePushConfig *graph.ImagePushConfig) error
- func (daemon *Daemon) Register(container *Container) error
- func (daemon *Daemon) Repositories() *graph.TagStore
- func (daemon *Daemon) Restore() error
- func (daemon *Daemon) SearchRegistryForImages(term string, authConfig *cliconfig.AuthConfig, headers map[string][]string) (*registry.SearchResults, error)
- func (daemon *Daemon) Setup() error
- func (daemon *Daemon) Shutdown() error
- func (daemon *Daemon) Start(container *Container) error
- func (daemon *Daemon) SubscribeToEvents() ([]*jsonmessage.JSONMessage, chan interface{}, func())
- func (daemon *Daemon) SystemConfig() *sysinfo.SysInfo
- func (daemon *Daemon) SystemInfo() (*types.Info, error)
- func (daemon *Daemon) SystemInitPath() string
- func (daemon *Daemon) TagImage(repoName, tag, imageName string, force bool) error
- func (daemon *Daemon) Unmount(container *Container) error
- func (daemon *Daemon) VolumeCreate(name, driverName string, opts map[string]string) (*types.Volume, error)
- func (daemon *Daemon) VolumeInspect(name string) (*types.Volume, error)
- func (daemon *Daemon) VolumeRm(name string) error
- func (daemon *Daemon) Volumes(filter string) ([]*types.Volume, error)
- type ExecConfig
- type History
- type State
Constants ¶
const ( // NetworkByID represents a constant to find a network by its ID NetworkByID = iota + 1 // NetworkByName represents a constant to find a network by its Name NetworkByName )
const DefaultPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
DefaultPathEnv is unix style list of directories to search for executables. Each directory is separated from the next by a colon ':' character .
Variables ¶
var ( ErrNotATTY = errors.New("The PTY is not a file") ErrNoTTY = errors.New("No PTY found") ErrContainerStart = errors.New("The container failed to start. Unknown error") ErrContainerStartTimeout = errors.New("The container failed to start due to timed out.") )
var ( // ErrVolumeReadonly is used to signal an error when trying to copy data into // a volume mount that is not writable. ErrVolumeReadonly = errors.New("mounted volume is marked read-only") )
Functions ¶
func GetFullContainerName ¶
Types ¶
type CommonConfig ¶
type CommonConfig struct { AutoRestart bool Context map[string][]string CorsHeaders string DisableBridge bool DNS []string DNSSearch []string EnableCors bool ExecDriver string ExecOptions []string ExecRoot string GraphDriver string GraphOptions []string Labels []string LogConfig runconfig.LogConfig Mtu int Pidfile string Root string TrustKeyPath string DefaultNetwork string // ClusterStore is the storage backend used for the cluster information. It is used by both // multihost networking (to store networks and endpoints information) and by the node discovery // mechanism. ClusterStore string // ClusterOpts is used to pass options to the discovery package for tuning libkv settings, such // as TLS configuration settings. ClusterOpts map[string]string // ClusterAdvertise is the network endpoint that the Engine advertises for the purpose of node // discovery. This should be a 'host:port' combination on which that daemon instance is // reachable by other hosts. ClusterAdvertise string }
CommonConfig defines the configuration of a docker daemon which are common across platforms.
type CommonContainer ¶
type CommonContainer struct { // embed for Container to support states directly. *State `json:"State"` // Needed for remote api version <= 1.11 ID string Created time.Time Path string Args []string Config *runconfig.Config ImageID string `json:"Image"` NetworkSettings *network.Settings ResolvConfPath string HostnamePath string HostsPath string LogPath string Name string Driver string ExecDriver string MountLabel, ProcessLabel string RestartCount int HasBeenStartedBefore bool HasBeenManuallyStopped bool // used for unless-stopped restart policy UpdateDns bool MountPoints map[string]*volume.MountPoint // contains filtered or unexported fields }
CommonContainer holds the settings for a container which are applicable across all platforms supported by the daemon.
func (*CommonContainer) StderrPipe ¶
func (streamConfig *CommonContainer) StderrPipe() io.ReadCloser
func (*CommonContainer) StdinPipe ¶
func (streamConfig *CommonContainer) StdinPipe() io.WriteCloser
func (*CommonContainer) StdoutPipe ¶
func (streamConfig *CommonContainer) StdoutPipe() io.ReadCloser
type Config ¶
type Config struct { CommonConfig CorsHeaders string EnableCors bool EnableSelinuxSupport bool RemappedRoot string // Bridge holds bridge network specific configuration. Bridge bridgeConfig SocketGroup string Ulimits map[string]*ulimit.Ulimit }
Config defines the configuration of a docker daemon. These are the configuration settings that you pass to the docker daemon when you launch it with say: `docker -d -e lxc`
func (*Config) InstallCommonFlags ¶
InstallCommonFlags adds command-line options to the top-level flag parser for the current process. Subsequent calls to `flag.Parse` will populate config with values parsed from the command-line.
func (*Config) InstallFlags ¶
InstallFlags adds command-line options to the top-level flag parser for the current process. Subsequent calls to `flag.Parse` will populate config with values parsed from the command-line.
type Container ¶
type Container struct { CommonContainer AppArmorProfile string HostnamePath string HostsPath string ShmPath string MqueuePath string ResolvConfPath string // contains filtered or unexported fields }
Container holds the fields specific to unixen implementations. See CommonContainer for standard fields common to all containers.
func (*Container) Attach ¶
func (container *Container) Attach(stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) chan error
Attach connects to the container's TTY, delegating to standard streams or websockets depending on the configuration.
func (*Container) DisconnectFromNetwork ¶
func (container *Container) DisconnectFromNetwork(n libnetwork.Network) error
DisconnectFromNetwork disconnects a container from a network
func (*Container) ExitOnNext ¶
func (container *Container) ExitOnNext()
ExitOnNext signals to the monitor that it should not restart the container after we send the kill signal.
func (*Container) GetResourcePath ¶
GetResourcePath evaluates `path` in the scope of the container's basefs, with proper path sanitisation. Symlinks are all scoped to the basefs of the container, as though the container's basefs was `/`.
The basefs of a container is the host-facing path which is bind-mounted as `/` inside the container. This method is essentially used to access a particular path inside the container as though you were a process in that container.
NOTE: The returned path is *only* safely scoped inside the container's basefs
if no component of the returned path changes (such as a component symlinking to a different path) between using this method and using the path. See symlink.FollowSymlinkInScope for more details.
func (*Container) HostConfig ¶
func (container *Container) HostConfig() *runconfig.HostConfig
func (*Container) LogDriverType ¶
func (*Container) SetHostConfig ¶
func (container *Container) SetHostConfig(hostConfig *runconfig.HostConfig)
func (*Container) StartLogger ¶
StartLogger starts a new logger driver for the container.
func (*Container) StderrPipe ¶
func (streamConfig *Container) StderrPipe() io.ReadCloser
func (*Container) StdinPipe ¶
func (streamConfig *Container) StdinPipe() io.WriteCloser
func (*Container) StdoutPipe ¶
func (streamConfig *Container) StdoutPipe() io.ReadCloser
type ContainerCommitConfig ¶
type ContainerCommitConfig struct { Pause bool Repo string Tag string Author string Comment string // merge container config into commit config before commit MergeConfigs bool Config *runconfig.Config }
ContainerCommitConfig contains build configs for commit operation, and is used when making a commit with the current state of the container.
type ContainerCreateConfig ¶
type ContainerCreateConfig struct { Name string Config *runconfig.Config HostConfig *runconfig.HostConfig }
ContainerCreateConfig is the parameter set to ContainerCreate()
type ContainerRmConfig ¶
type ContainerRmConfig struct {
ForceRemove, RemoveVolume, RemoveLink bool
}
ContainerRmConfig is a holder for passing in runtime config.
type ContainersConfig ¶
type ContainersConfig struct { // if true show all containers, otherwise only running containers. All bool // show all containers created after this container id Since string // show all containers created before this container id Before string // number of containers to return at most Limit int // if true include the sizes of the containers Size bool // return only containers that match filters Filters string }
ContainersConfig is the filtering specified by the user to iterate over containers.
type Daemon ¶
type Daemon struct { ID string RegistryService *registry.Service EventsService *events.Events // contains filtered or unexported fields }
Daemon holds information about the Docker daemon.
func (*Daemon) AuthenticateToRegistry ¶
func (daemon *Daemon) AuthenticateToRegistry(authConfig *cliconfig.AuthConfig) (string, error)
AuthenticateToRegistry checks the validity of credentials in authConfig
func (*Daemon) Cleanup ¶
Cleanup releases any network resources allocated to the container along with any rules around how containers are linked together. It also unmounts the container's root filesystem.
func (*Daemon) Commit ¶
Commit creates a new filesystem image from the current state of a container. The image can optionally be tagged into a repository.
func (*Daemon) ConnectContainerToNetwork ¶
ConnectContainerToNetwork connects the given container to the given network. If either cannot be found, an err is returned. If the network cannot be set up, an err is returned.
func (*Daemon) ConnectToNetwork ¶
ConnectToNetwork connects a container to a network
func (*Daemon) ContainerChanges ¶
ContainerChanges returns a list of container fs changes
func (*Daemon) ContainerCreate ¶
func (daemon *Daemon) ContainerCreate(params *ContainerCreateConfig) (types.ContainerCreateResponse, error)
ContainerCreate takes configs and creates a container.
func (*Daemon) ContainerExecCreate ¶
func (d *Daemon) ContainerExecCreate(config *runconfig.ExecConfig) (string, error)
ContainerExecCreate sets up an exec in a running container.
func (*Daemon) ContainerExecInspect ¶
func (daemon *Daemon) ContainerExecInspect(id string) (*ExecConfig, error)
ContainerExecInspect returns low-level information about the exec command. An error is returned if the exec cannot be found.
func (*Daemon) ContainerExecStart ¶
func (d *Daemon) ContainerExecStart(name string, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) error
ContainerExecStart starts a previously set up exec instance. The std streams are set up.
func (*Daemon) ContainerGraph ¶
func (*Daemon) ContainerInspect ¶
ContainerInspect returns low-level information about a container. Returns an error if the container cannot be found, or if there is an error getting the data.
func (*Daemon) ContainerInspect120 ¶
func (daemon *Daemon) ContainerInspect120(name string) (*v1p20.ContainerJSON, error)
ContainerInspect120 serializes the master version of a container into a json type.
func (*Daemon) ContainerInspectPre120 ¶
func (daemon *Daemon) ContainerInspectPre120(name string) (*v1p19.ContainerJSON, error)
ContainerInspectPre120 gets containers for pre 1.20 APIs.
func (*Daemon) ContainerKill ¶
ContainerKill send signal to the container If no signal is given (sig 0), then Kill with SIGKILL and wait for the container to exit. If a signal is given, then just send it to the container and return.
func (*Daemon) ContainerPause ¶
ContainerPause pauses a container
func (*Daemon) ContainerRename ¶
func (*Daemon) ContainerRm ¶
func (daemon *Daemon) ContainerRm(name string, config *ContainerRmConfig) error
ContainerRm removes the container id from the filesystem. An error is returned if the container is not found, or if the remove fails. If the remove succeeds, the container name is released, and network links are removed.
func (*Daemon) ContainerStart ¶
func (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConfig) error
ContainerStart starts a container.
func (*Daemon) ContainerStop ¶
ContainerStop looks for the given container and terminates it, waiting the given number of seconds before forcefully killing the container. If a negative number of seconds is given, ContainerStop will wait for a graceful termination. An error is returned if the container is not found, is already stopped, or if there is a problem stopping the container.
func (*Daemon) ContainerUnpause ¶
ContainerUnpause unpauses a container
func (*Daemon) Containers ¶
func (daemon *Daemon) Containers(config *ContainersConfig) ([]*types.Container, error)
Containers returns the list of containers to show given the user's filtering.
func (*Daemon) CreateNetwork ¶
func (daemon *Daemon) CreateNetwork(name, driver string, ipam network.IPAM, options map[string]string) (libnetwork.Network, error)
CreateNetwork creates a network with the given name, driver and other optional parameters
func (*Daemon) DisconnectContainerFromNetwork ¶
func (daemon *Daemon) DisconnectContainerFromNetwork(containerName string, network libnetwork.Network) error
DisconnectContainerFromNetwork disconnects the given container from the given network. If either cannot be found, an err is returned.
func (*Daemon) Exec ¶
func (d *Daemon) Exec(c *Container, ExecConfig *ExecConfig, pipes *execdriver.Pipes, startCallback execdriver.DriverCallback) (int, error)
Exec calls the underlying exec driver to run
func (*Daemon) ExecExists ¶
ExecExists looks up the exec instance and returns a bool if it exists or not. It will also return the error produced by `getExecConfig`
func (*Daemon) ExecutionDriver ¶
func (daemon *Daemon) ExecutionDriver() execdriver.Driver
ExecutionDriver returns the currently used driver for creating and starting execs in a container.
func (*Daemon) Exists ¶
Exists returns a true if a container of the specified ID or name exists, false otherwise.
func (*Daemon) ExportImage ¶
ExportImage exports a list of images to the given output stream. The exported images are archived into a tar when written to the output stream. All images with the given tag and all versions containing the same tag are exported. names is the set of tags to export, and outStream is the writer which the images are written to.
func (*Daemon) FindNetwork ¶
func (daemon *Daemon) FindNetwork(idName string) (libnetwork.Network, error)
FindNetwork function finds a network for a given string that can represent network name or id
func (*Daemon) Get ¶
Get looks for a container using the provided information, which could be one of the following inputs from the caller:
- A full container ID, which will exact match a container in daemon's list
- A container name, which will only exact match via the GetByName() function
- A partial container ID prefix (e.g. short ID) of any length that is unique enough to only return a single container object If none of these searches succeed, an error is returned
func (*Daemon) GetContainerStats ¶
func (daemon *Daemon) GetContainerStats(container *Container) (*execdriver.ResourceStats, error)
GetContainerStats collects all the stats published by a container
func (*Daemon) GetEventFilter ¶
GetEventFilter returns a filters.Filter for a set of filters
func (*Daemon) GetImage ¶
GetImage returns pointer to an Image struct corresponding to the given name. The name can include an optional tag; otherwise the default tag will be used.
func (*Daemon) GetNetwork ¶
GetNetwork function returns a network for a given string that represents the network and a hint to indicate if the string is an Id or Name of the network
func (*Daemon) GetNetworkDriverList ¶
GetNetworkDriverList returns the list of plugins drivers registered for network.
func (*Daemon) GetNetworksByID ¶
func (daemon *Daemon) GetNetworksByID(partialID string) []libnetwork.Network
GetNetworksByID returns a list of networks whose ID partially matches zero or more networks
func (*Daemon) GetRemappedUIDGID ¶
GetRemappedUIDGID returns the current daemon's uid and gid values if user namespaces are in use for this daemon instance. If not this function will return "real" root values of 0, 0.
func (*Daemon) GetUIDGIDMaps ¶
GetUIDGIDMaps returns the current daemon's user namespace settings for the full uid and gid maps which will be applied to containers started in this instance.
func (*Daemon) Graph ¶
FIXME: this is a convenience function for integration tests which need direct access to daemon.graph. Once the tests switch to using engine and jobs, this method can go away.
func (*Daemon) GraphDriver ¶
func (daemon *Daemon) GraphDriver() graphdriver.Driver
func (*Daemon) ImageDelete ¶
ImageDelete deletes the image referenced by the given imageRef from this daemon. The given imageRef can be an image ID, ID prefix, or a repository reference (with an optional tag or digest, defaulting to the tag name "latest"). There is differing behavior depending on whether the given imageRef is a repository reference or not.
If the given imageRef is a repository reference then that repository reference will be removed. However, if there exists any containers which were created using the same image reference then the repository reference cannot be removed unless either there are other repository references to the same image or force is true. Following removal of the repository reference, the referenced image itself will attempt to be deleted as described below but quietly, meaning any image delete conflicts will cause the image to not be deleted and the conflict will not be reported.
There may be conflicts preventing deletion of an image and these conflicts are divided into two categories grouped by their severity:
Hard Conflict:
- a pull or build using the image.
- any descendent image.
- any running container using the image.
Soft Conflict:
- any stopped container using the image.
- any repository tag or digest references to the image.
The image cannot be removed if there are any hard conflicts and can be removed if there are soft conflicts only if force is true.
If prune is true, ancestor images will each attempt to be deleted quietly, meaning any delete conflicts will cause the image to not be deleted and the conflict will not be reported.
FIXME: remove ImageDelete's dependency on Daemon, then move to the graph package. This would require that we no longer need the daemon to determine whether images are being used by a stopped or running container.
func (*Daemon) ImageGetCached ¶
func (*Daemon) ImageHistory ¶
func (daemon *Daemon) ImageHistory(name string) ([]*types.ImageHistory, error)
ImageHistory returns a slice of ImageHistory structures for the specified image name by walking the image lineage.
func (*Daemon) ImportImage ¶
func (daemon *Daemon) ImportImage(src, repo, tag, msg string, inConfig io.ReadCloser, outStream io.Writer, containerConfig *runconfig.Config) error
ImportImage imports an image, getting the archived layer data either from inConfig (if src is "-"), or from a URI specified in src. Progress output is written to outStream. Repository and tag names can optionally be given in the repo and tag arguments, respectively.
func (*Daemon) IsShuttingDown ¶
IsShuttingDown tells whether the daemon is shutting down or not
func (*Daemon) ListImages ¶
ListImages returns a filtered list of images. filterArgs is a JSON-encoded set of filter arguments which will be interpreted by pkg/parsers/filters. filter is a shell glob string applied to repository names. The argument named all controls whether all images in the graph are filtered, or just the heads.
func (*Daemon) LoadImage ¶
LoadImage uploads a set of images into the repository. This is the complement of ImageExport. The input stream is an uncompressed tar ball containing images and metadata.
func (*Daemon) LookupImage ¶
func (daemon *Daemon) LookupImage(name string) (*types.ImageInspect, error)
LookupImage looks up an image by name and returns it as an ImageInspect structure.
func (*Daemon) NetworkControllerEnabled ¶
NetworkControllerEnabled checks if the networking stack is enabled. This feature depends on OS primitives and it's dissabled in systems like Windows.
func (*Daemon) PullImage ¶
func (daemon *Daemon) PullImage(image string, tag string, imagePullConfig *graph.ImagePullConfig) error
PullImage initiates a pull operation. image is the repository name to pull, and tag may be either empty, or indicate a specific tag to pull.
func (*Daemon) PushImage ¶
func (daemon *Daemon) PushImage(localName string, imagePushConfig *graph.ImagePushConfig) error
PushImage initiates a push operation on the repository named localName.
func (*Daemon) Register ¶
Register makes a container object usable by the daemon as <container.ID> This is a wrapper for register
func (*Daemon) Repositories ¶
func (*Daemon) SearchRegistryForImages ¶
func (daemon *Daemon) SearchRegistryForImages(term string, authConfig *cliconfig.AuthConfig, headers map[string][]string) (*registry.SearchResults, error)
SearchRegistryForImages queries the registry for images matching term. authConfig is used to login.
func (*Daemon) SubscribeToEvents ¶
func (daemon *Daemon) SubscribeToEvents() ([]*jsonmessage.JSONMessage, chan interface{}, func())
SubscribeToEvents returns the currently record of events, a channel to stream new events from, and a function to cancel the stream of events.
func (*Daemon) SystemConfig ¶
func (*Daemon) SystemInfo ¶
SystemInfo returns information about the host server the daemon is running on.
func (*Daemon) SystemInitPath ¶
func (*Daemon) TagImage ¶
TagImage creates a tag in the repository reponame, pointing to the image named imageName. If force is true, an existing tag with the same name may be overwritten.
func (*Daemon) VolumeCreate ¶
func (daemon *Daemon) VolumeCreate(name, driverName string, opts map[string]string) (*types.Volume, error)
VolumeCreate creates a volume with the specified name, driver, and opts This is called directly from the remote API
func (*Daemon) VolumeInspect ¶
VolumeInspect looks up a volume by name. An error is returned if the volume cannot be found.
type ExecConfig ¶
type ExecConfig struct { sync.Mutex ID string Running bool ExitCode int ProcessConfig *execdriver.ProcessConfig OpenStdin bool OpenStderr bool OpenStdout bool Container *Container // contains filtered or unexported fields }
ExecConfig holds the configurations for execs. The Daemon keeps track of both running and finished execs so that they can be examined both during and after completion.
func (*ExecConfig) StderrPipe ¶
func (streamConfig *ExecConfig) StderrPipe() io.ReadCloser
func (*ExecConfig) StdinPipe ¶
func (streamConfig *ExecConfig) StdinPipe() io.WriteCloser
func (*ExecConfig) StdoutPipe ¶
func (streamConfig *ExecConfig) StdoutPipe() io.ReadCloser
type History ¶
type History []*Container
History is a convenience type for storing a list of containers, ordered by creation date.
type State ¶
type State struct { sync.Mutex // FIXME: Why do we have both paused and running if a // container cannot be paused and running at the same time? Running bool Paused bool Restarting bool OOMKilled bool Dead bool Pid int ExitCode int Error string // contains last known error when starting the container StartedAt time.Time FinishedAt time.Time // contains filtered or unexported fields }
State holds the current container state, and has methods to get and set the state. Container has an embed, which allows all of the functions defined against State to run against Container.
func NewState ¶
func NewState() *State
NewState creates a default state object with a fresh channel for state changes.
func (*State) IsRunning ¶
IsRunning returns whether the running flag is set. Used by Container to check whether a container is running.
func (*State) StateString ¶
StateString returns a single string to describe state
Source Files ¶
- changes.go
- commit.go
- config.go
- config_linux.go
- container.go
- container_linux.go
- create.go
- create_unix.go
- daemon.go
- daemon_aufs_linux.go
- daemon_devicemapper_linux.go
- daemon_overlay_linux.go
- daemon_stub.go
- daemon_unix.go
- daemon_vbox.go
- delete.go
- errors.go
- exec.go
- exec_unix.go
- history.go
- image_delete.go
- info.go
- inspect.go
- inspect_unix.go
- kill.go
- list.go
- list_unix.go
- mounts.go
- network.go
- pause.go
- rename.go
- selinux_linux.go
- start.go
- state.go
- state_unix.go
- stop.go
- unpause.go
- volumes.go
- volumes_unix.go