package daemon
import "github.com/docker/docker/daemon"
Index ¶
- Constants
- Variables
- func GetFullContainerName(name string) (string, error)
- type CommonConfig
- type CommonContainer
- type Container
- func (container *Container) AllocateNetwork() error
- func (container *Container) ArchivePath(path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error)
- func (c *Container) Attach(stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) chan error
- func (c *Container) AttachWithLogs(stdin io.ReadCloser, stdout, stderr io.Writer, logs, stream bool) error
- func (container *Container) Changes() ([]archive.Change, error)
- func (container *Container) CleanupStorage() error
- func (container *Container) Copy(resource string) (rc io.ReadCloser, err error)
- func (container *Container) DisableLink(name string)
- func (container *Container) Exec(execConfig *execConfig) error
- func (container *Container) Export() (archive.Archive, error)
- func (container *Container) ExportRw() (archive.Archive, error)
- func (container *Container) Exposes(p nat.Port) bool
- func (container *Container) ExtractToDir(path string, noOverwriteDirNonDir bool, content io.Reader) (err error)
- func (container *Container) FromDisk() error
- func (container *Container) GetExecIDs() []string
- func (container *Container) GetImage() (*image.Image, error)
- func (container *Container) GetMountLabel() string
- func (container *Container) GetProcessLabel() string
- func (container *Container) GetResourcePath(path string) (string, error)
- func (container *Container) GetRootResourcePath(path string) (string, error)
- func (container *Container) GetSize() (int64, int64)
- 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) LogEvent(action string)
- func (container *Container) Mount() error
- func (container *Container) Output() (output []byte, err error)
- func (container *Container) Pause() error
- func (container *Container) PrepareStorage() error
- func (container *Container) ReleaseNetwork()
- func (container *Container) Resize(h, w int) error
- func (container *Container) Restart(seconds int) error
- func (container *Container) RootfsPath() string
- func (container *Container) Run() error
- func (container *Container) SetHostConfig(hostConfig *runconfig.HostConfig)
- func (container *Container) Start() (err error)
- func (container *Container) StatPath(path string) (stat *types.ContainerPathStat, err error)
- func (container *Container) Stats() (*execdriver.ResourceStats, error)
- func (container *Container) Stop(seconds int) error
- func (container *Container) ToDisk() error
- func (container *Container) Unmount() error
- func (container *Container) UnmountVolumes(forceSyscall bool) error
- func (container *Container) Unpause() error
- func (container *Container) UpdateNetwork() error
- func (container *Container) WriteHostConfig() error
- type ContainerAttachWithLogsConfig
- type ContainerCommitConfig
- type ContainerLogsConfig
- type ContainerRmConfig
- type ContainerStatsConfig
- type ContainerWsAttachWithLogsConfig
- type ContainersConfig
- type Daemon
- func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemon, err error)
- func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error)
- func (daemon *Daemon) Children(name string) (map[string]*Container, error)
- func (daemon *Daemon) Commit(container *Container, c *ContainerCommitConfig) (*image.Image, error)
- func (daemon *Daemon) Config() *Config
- func (daemon *Daemon) ContainerArchivePath(name string, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error)
- func (daemon *Daemon) ContainerAttachWithLogs(container *Container, c *ContainerAttachWithLogsConfig) error
- func (daemon *Daemon) ContainerChanges(name string) ([]archive.Change, error)
- func (daemon *Daemon) ContainerCopy(name string, res string) (io.ReadCloser, error)
- func (daemon *Daemon) ContainerCreate(name string, config *runconfig.Config, hostConfig *runconfig.HostConfig) (string, []string, error)
- func (d *Daemon) ContainerExecCreate(config *runconfig.ExecConfig) (string, error)
- func (daemon *Daemon) ContainerExecInspect(id string) (*execConfig, error)
- func (daemon *Daemon) ContainerExecResize(name string, height, width int) error
- func (d *Daemon) ContainerExecStart(execName string, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) error
- func (daemon *Daemon) ContainerExport(name string, out io.Writer) error
- func (daemon *Daemon) ContainerExtractToDir(name, path string, noOverwriteDirNonDir bool, content io.Reader) error
- func (daemon *Daemon) ContainerGraph() *graphdb.Database
- func (daemon *Daemon) ContainerInspect(name string) (*types.ContainerJSON, error)
- func (daemon *Daemon) ContainerInspectPre120(name string) (*types.ContainerJSONPre120, error)
- func (daemon *Daemon) ContainerKill(name string, sig uint64) error
- func (daemon *Daemon) ContainerLogs(container *Container, config *ContainerLogsConfig) error
- func (daemon *Daemon) ContainerPause(name string) error
- func (daemon *Daemon) ContainerRename(oldName, newName string) error
- func (daemon *Daemon) ContainerResize(name string, height, width int) error
- func (daemon *Daemon) ContainerRestart(name string, seconds int) error
- func (daemon *Daemon) ContainerRm(name string, config *ContainerRmConfig) error
- func (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConfig) error
- func (daemon *Daemon) ContainerStatPath(name string, path string) (stat *types.ContainerPathStat, err error)
- func (daemon *Daemon) ContainerStats(name string, config *ContainerStatsConfig) error
- func (daemon *Daemon) ContainerStop(name string, seconds int) error
- func (daemon *Daemon) ContainerTop(name string, psArgs string) (*types.ContainerProcessList, error)
- func (daemon *Daemon) ContainerUnpause(name string) error
- func (daemon *Daemon) ContainerWait(name string, timeout time.Duration) (int, error)
- func (daemon *Daemon) ContainerWsAttachWithLogs(container *Container, c *ContainerWsAttachWithLogsConfig) error
- func (daemon *Daemon) Containers(config *ContainersConfig) ([]*types.Container, error)
- func (daemon *Daemon) Create(config *runconfig.Config, hostConfig *runconfig.HostConfig, name string) (*Container, []string, error)
- func (daemon *Daemon) DeleteVolumes(c *Container) error
- func (daemon *Daemon) Diff(container *Container) (archive.Archive, error)
- func (d *Daemon) Exec(c *Container, execConfig *execConfig, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error)
- func (daemon *Daemon) ExecutionDriver() execdriver.Driver
- func (daemon *Daemon) Exists(id string) bool
- func (daemon *Daemon) GenerateSecurityOpt(ipcMode runconfig.IpcMode, pidMode runconfig.PidMode) ([]string, error)
- func (daemon *Daemon) Get(prefixOrName string) (*Container, error)
- func (daemon *Daemon) GetByName(name string) (*Container, error)
- func (daemon *Daemon) Graph() *graph.Graph
- func (daemon *Daemon) GraphDriver() graphdriver.Driver
- func (daemon *Daemon) ImageDelete(name string, force, noprune bool) ([]types.ImageDelete, error)
- func (daemon *Daemon) ImageGetCached(imgID string, config *runconfig.Config) (*image.Image, error)
- func (daemon *Daemon) Kill(c *Container, sig int) error
- func (daemon *Daemon) List() []*Container
- func (daemon *Daemon) Mount(container *Container) error
- func (daemon *Daemon) NetworkApiRouter() func(w http.ResponseWriter, req *http.Request)
- func (daemon *Daemon) Parents(name string) ([]string, error)
- func (daemon *Daemon) Register(container *Container) error
- func (daemon *Daemon) RegisterLink(parent, child *Container, alias string) error
- func (daemon *Daemon) RegisterLinks(container *Container, hostConfig *runconfig.HostConfig) error
- func (daemon *Daemon) Repositories() *graph.TagStore
- func (daemon *Daemon) Run(c *Container, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (execdriver.ExitStatus, error)
- func (daemon *Daemon) Shutdown() error
- func (daemon *Daemon) Stats(c *Container) (*execdriver.ResourceStats, error)
- func (daemon *Daemon) SubscribeToContainerStats(name string) (chan interface{}, error)
- func (daemon *Daemon) SystemConfig() *sysinfo.SysInfo
- func (daemon *Daemon) SystemInfo() (*types.Info, error)
- func (daemon *Daemon) SystemInitPath() string
- func (daemon *Daemon) Unmount(container *Container) error
- func (daemon *Daemon) UnsubscribeToContainerStats(name string, ch chan interface{}) error
- type ErrContainerNotRunning
- type History
- func (history *History) Add(container *Container)
- func (history *History) Len() int
- func (history *History) Less(i, j int) bool
- func (history *History) Sort()
- func (history *History) Swap(i, j int)
- type State
- func NewState() *State
- func (s *State) GetExitCode() int
- func (s *State) GetPid() int
- func (s *State) IsPaused() bool
- func (s *State) IsRestarting() bool
- func (s *State) IsRunning() bool
- func (s *State) ResetRemovalInProgress()
- func (s *State) SetDead()
- func (s *State) SetPaused()
- func (s *State) SetRemovalInProgress() error
- func (s *State) SetRestarting(exitStatus *execdriver.ExitStatus)
- func (s *State) SetRunning(pid int)
- func (s *State) SetStopped(exitStatus *execdriver.ExitStatus)
- func (s *State) SetUnpaused()
- func (s *State) StateString() string
- func (s *State) String() string
- func (s *State) WaitRunning(timeout time.Duration) (int, error)
- func (s *State) WaitStop(timeout time.Duration) (int, error)
- type StreamConfig
Constants ¶
const DefaultPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
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.") ErrContainerRootfsReadonly = errors.New("container rootfs is marked read-only") )
ErrExtractPointNotDirectory is used to convey that the operation to extract a tar archive to a directory in a container has failed because the specified path does not refer to a directory.
ErrVolumeReadonly is used to signal an error when trying to copy data into a volume mount that is not writable.
Functions ¶
func GetFullContainerName ¶
Types ¶
type CommonConfig ¶
type CommonConfig struct { AutoRestart bool Bridge bridgeConfig // Bridge holds bridge network specific configuration. 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 NetworkKVStore string }
CommonConfig defines the configuration of a docker daemon which are common across platforms.
type CommonContainer ¶
type CommonContainer struct { StreamConfig *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 UpdateDns bool HasBeenStartedBefore bool MountPoints map[string]*mountPoint Volumes map[string]string // Deprecated since 1.7, kept for backwards compatibility VolumesRW map[string]bool // Deprecated since 1.7, kept for backwards compatibility // contains filtered or unexported fields }
CommonContainer holds the settings for a container which are applicable across all platforms supported by the daemon.
type Container ¶
type Container struct { CommonContainer AppArmorProfile string // contains filtered or unexported fields }
func (*Container) AllocateNetwork ¶
func (*Container) ArchivePath ¶
func (container *Container) ArchivePath(path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error)
ArchivePath creates an archive of the filesystem resource at the specified path in this container. Returns a tar archive of the resource and stat info about the resource.
func (*Container) Attach ¶
func (*Container) AttachWithLogs ¶
func (c *Container) AttachWithLogs(stdin io.ReadCloser, stdout, stderr io.Writer, logs, stream bool) error
func (*Container) Changes ¶
func (*Container) CleanupStorage ¶
func (*Container) Copy ¶
func (container *Container) Copy(resource string) (rc io.ReadCloser, err error)
func (*Container) DisableLink ¶
func (*Container) Exec ¶
func (*Container) Export ¶
func (*Container) ExportRw ¶
func (*Container) Exposes ¶
Returns true if the container exposes a certain port
func (*Container) ExtractToDir ¶
func (container *Container) ExtractToDir(path string, noOverwriteDirNonDir bool, content io.Reader) (err error)
ExtractToDir extracts the given tar archive to the specified location in the filesystem of this container. The given path must be of a directory in the container. If it is not, the error will be ErrExtractPointNotDirectory. If noOverwriteDirNonDir is true then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non- directory and vice versa.
func (*Container) FromDisk ¶
func (*Container) GetExecIDs ¶
func (*Container) GetImage ¶
func (*Container) GetMountLabel ¶
func (*Container) GetProcessLabel ¶
func (*Container) 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) GetRootResourcePath ¶
Evaluates `path` in the scope of the container's root, with proper path sanitisation. Symlinks are all scoped to the root of the container, as though the container's root was `/`.
The root of a container is the host-facing configuration metadata directory. Only use this method to safely access the container's `container.json` or other metadata files. If in doubt, use container.GetResourcePath.
NOTE: The returned path is *only* safely scoped inside the container's root
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) GetSize ¶
GetSize, return real size, virtual size
func (*Container) HostConfig ¶
func (container *Container) HostConfig() *runconfig.HostConfig
func (*Container) Kill ¶
func (*Container) KillSig ¶
func (*Container) LogDriverType ¶
func (*Container) LogEvent ¶
func (*Container) Mount ¶
func (*Container) Output ¶
func (*Container) Pause ¶
func (*Container) PrepareStorage ¶
func (*Container) ReleaseNetwork ¶
func (container *Container) ReleaseNetwork()
func (*Container) Resize ¶
func (*Container) Restart ¶
func (*Container) RootfsPath ¶
This method must be exported to be used from the lxc template This directory is only usable when the container is running
func (*Container) Run ¶
func (*Container) SetHostConfig ¶
func (container *Container) SetHostConfig(hostConfig *runconfig.HostConfig)
func (*Container) Start ¶
func (*Container) StatPath ¶
func (container *Container) StatPath(path string) (stat *types.ContainerPathStat, err error)
StatPath stats the filesystem resource at the specified path in this container. Returns stat info about the resource.
func (*Container) Stats ¶
func (container *Container) Stats() (*execdriver.ResourceStats, error)
func (*Container) Stop ¶
func (*Container) ToDisk ¶
func (*Container) Unmount ¶
func (*Container) UnmountVolumes ¶
func (*Container) Unpause ¶
func (*Container) UpdateNetwork ¶
func (*Container) WriteHostConfig ¶
type ContainerAttachWithLogsConfig ¶
type ContainerAttachWithLogsConfig struct { InStream io.ReadCloser OutStream io.Writer UseStdin, UseStdout, UseStderr bool Logs, Stream bool }
type ContainerCommitConfig ¶
type ContainerCommitConfig struct { Pause bool Repo string Tag string Author string Comment string Config *runconfig.Config }
type ContainerLogsConfig ¶
type ContainerLogsConfig struct { Follow, Timestamps bool Tail string Since time.Time UseStdout, UseStderr bool OutStream io.Writer Stop <-chan bool }
type ContainerRmConfig ¶
type ContainerRmConfig struct { ForceRemove, RemoveVolume, RemoveLink bool }
type ContainerStatsConfig ¶
type ContainerWsAttachWithLogsConfig ¶
type ContainerWsAttachWithLogsConfig struct { InStream io.ReadCloser OutStream, ErrStream io.Writer Logs, Stream bool }
type ContainersConfig ¶
type ContainersConfig struct { All bool Since string Before string Limit int Size bool Filters string }
type Daemon ¶
type Daemon struct { ID string RegistryService *registry.Service EventsService *events.Events // contains filtered or unexported fields }
func NewDaemon ¶
func (*Daemon) Changes ¶
func (*Daemon) Children ¶
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) Config ¶
func (daemon *Daemon) Config() *Config
func (*Daemon) ContainerArchivePath ¶
func (daemon *Daemon) ContainerArchivePath(name string, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error)
ContainerArchivePath creates an archive of the filesystem resource at the specified path in the container identified by the given name. Returns a tar archive of the resource and whether it was a directory or a single file.
func (*Daemon) ContainerAttachWithLogs ¶
func (daemon *Daemon) ContainerAttachWithLogs(container *Container, c *ContainerAttachWithLogsConfig) error
func (*Daemon) ContainerChanges ¶
ContainerChanges returns a list of container fs changes
func (*Daemon) ContainerCopy ¶
ContainerCopy performs a depracated operation of archiving the resource at the specified path in the conatiner identified by the given name.
func (*Daemon) ContainerCreate ¶
func (daemon *Daemon) ContainerCreate(name string, config *runconfig.Config, hostConfig *runconfig.HostConfig) (string, []string, error)
func (*Daemon) ContainerExecCreate ¶
func (d *Daemon) ContainerExecCreate(config *runconfig.ExecConfig) (string, error)
func (*Daemon) ContainerExecInspect ¶
func (*Daemon) ContainerExecResize ¶
func (*Daemon) ContainerExecStart ¶
func (d *Daemon) ContainerExecStart(execName string, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) error
func (*Daemon) ContainerExport ¶
func (*Daemon) ContainerExtractToDir ¶
func (daemon *Daemon) ContainerExtractToDir(name, path string, noOverwriteDirNonDir bool, content io.Reader) error
ContainerExtractToDir extracts the given archive to the specified location in the filesystem of the container identified by the given name. The given path must be of a directory in the container. If it is not, the error will be ErrExtractPointNotDirectory. If noOverwriteDirNonDir is true then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa.
func (*Daemon) ContainerGraph ¶
func (*Daemon) ContainerInspect ¶
func (daemon *Daemon) ContainerInspect(name string) (*types.ContainerJSON, error)
func (*Daemon) ContainerInspectPre120 ¶
func (daemon *Daemon) ContainerInspectPre120(name string) (*types.ContainerJSONPre120, error)
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) ContainerLogs ¶
func (daemon *Daemon) ContainerLogs(container *Container, config *ContainerLogsConfig) error
func (*Daemon) ContainerPause ¶
ContainerPause pauses a container
func (*Daemon) ContainerRename ¶
func (*Daemon) ContainerResize ¶
func (*Daemon) ContainerRestart ¶
func (*Daemon) ContainerRm ¶
func (daemon *Daemon) ContainerRm(name string, config *ContainerRmConfig) error
func (*Daemon) ContainerStart ¶
func (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConfig) error
func (*Daemon) ContainerStatPath ¶
func (daemon *Daemon) ContainerStatPath(name string, path string) (stat *types.ContainerPathStat, err error)
ContainerStatPath stats the filesystem resource at the specified path in the container identified by the given name.
func (*Daemon) ContainerStats ¶
func (daemon *Daemon) ContainerStats(name string, config *ContainerStatsConfig) error
func (*Daemon) ContainerStop ¶
func (*Daemon) ContainerTop ¶
func (*Daemon) ContainerUnpause ¶
ContainerUnpause unpauses a container
func (*Daemon) ContainerWait ¶
func (*Daemon) ContainerWsAttachWithLogs ¶
func (daemon *Daemon) ContainerWsAttachWithLogs(container *Container, c *ContainerWsAttachWithLogsConfig) error
func (*Daemon) Containers ¶
func (daemon *Daemon) Containers(config *ContainersConfig) ([]*types.Container, error)
func (*Daemon) Create ¶
func (daemon *Daemon) Create(config *runconfig.Config, hostConfig *runconfig.HostConfig, name string) (*Container, []string, error)
Create creates a new container from the given configuration with a given name.
func (*Daemon) DeleteVolumes ¶
func (*Daemon) Diff ¶
func (*Daemon) Exec ¶
func (d *Daemon) Exec(c *Container, execConfig *execConfig, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error)
func (*Daemon) ExecutionDriver ¶
func (daemon *Daemon) ExecutionDriver() execdriver.Driver
func (*Daemon) Exists ¶
Exists returns a true if a container of the specified ID or name exists, false otherwise.
func (*Daemon) GenerateSecurityOpt ¶
func (daemon *Daemon) GenerateSecurityOpt(ipcMode runconfig.IpcMode, pidMode runconfig.PidMode) ([]string, error)
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) GetByName ¶
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 ¶
FIXME: remove ImageDelete's dependency on Daemon, then move to graph/
func (*Daemon) ImageGetCached ¶
func (*Daemon) Kill ¶
func (*Daemon) List ¶
List returns an array of all containers registered in the daemon.
func (*Daemon) Mount ¶
func (*Daemon) NetworkApiRouter ¶
func (daemon *Daemon) NetworkApiRouter() func(w http.ResponseWriter, req *http.Request)
func (*Daemon) Parents ¶
func (*Daemon) Register ¶
Register makes a container object usable by the daemon as <container.ID> This is a wrapper for register
func (*Daemon) RegisterLink ¶
func (*Daemon) RegisterLinks ¶
func (daemon *Daemon) RegisterLinks(container *Container, hostConfig *runconfig.HostConfig) error
func (*Daemon) Repositories ¶
func (*Daemon) Run ¶
func (daemon *Daemon) Run(c *Container, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (execdriver.ExitStatus, error)
func (*Daemon) Shutdown ¶
func (*Daemon) Stats ¶
func (daemon *Daemon) Stats(c *Container) (*execdriver.ResourceStats, error)
func (*Daemon) SubscribeToContainerStats ¶
func (*Daemon) SystemConfig ¶
func (*Daemon) SystemInfo ¶
func (*Daemon) SystemInitPath ¶
func (*Daemon) Unmount ¶
func (*Daemon) UnsubscribeToContainerStats ¶
type ErrContainerNotRunning ¶
type ErrContainerNotRunning struct {
// contains filtered or unexported fields
}
func (ErrContainerNotRunning) Error ¶
func (e ErrContainerNotRunning) Error() string
type History ¶
type History []*Container
History is a convenience type for storing a list of containers, ordered by creation date.
func (*History) Add ¶
func (*History) Len ¶
func (*History) Less ¶
func (*History) Sort ¶
func (history *History) Sort()
func (*History) Swap ¶
type State ¶
type State struct { sync.Mutex 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 }
func NewState ¶
func NewState() *State
func (*State) GetExitCode ¶
func (*State) GetPid ¶
func (*State) IsPaused ¶
func (*State) IsRestarting ¶
func (*State) IsRunning ¶
func (*State) ResetRemovalInProgress ¶
func (s *State) ResetRemovalInProgress()
func (*State) SetDead ¶
func (s *State) SetDead()
func (*State) SetPaused ¶
func (s *State) SetPaused()
func (*State) SetRemovalInProgress ¶
func (*State) SetRestarting ¶
func (s *State) SetRestarting(exitStatus *execdriver.ExitStatus)
SetRestarting is when docker handles the auto restart of containers when they are in the middle of a stop and being restarted again
func (*State) SetRunning ¶
func (*State) SetStopped ¶
func (s *State) SetStopped(exitStatus *execdriver.ExitStatus)
func (*State) SetUnpaused ¶
func (s *State) SetUnpaused()
func (*State) StateString ¶
StateString returns a single string to describe state
func (*State) String ¶
String returns a human-readable description of the state
func (*State) WaitRunning ¶
WaitRunning waits until state is running. If state already running it returns immediately. If you want wait forever you must supply negative timeout. Returns pid, that was passed to SetRunning
func (*State) WaitStop ¶
WaitStop waits until state is stopped. If state already stopped it returns immediately. If you want wait forever you must supply negative timeout. Returns exit code, that was passed to SetStopped
type StreamConfig ¶
type StreamConfig struct {
// contains filtered or unexported fields
}
func (*StreamConfig) StderrPipe ¶
func (streamConfig *StreamConfig) StderrPipe() io.ReadCloser
func (*StreamConfig) StdinPipe ¶
func (streamConfig *StreamConfig) StdinPipe() io.WriteCloser
func (*StreamConfig) StdoutPipe ¶
func (streamConfig *StreamConfig) StdoutPipe() io.ReadCloser
Source Files ¶
archive.go attach.go changes.go commit.go config.go config_stub.go container.go container_unix.go create.go daemon.go daemon_unix.go debugtrap_unix.go debugtrap_unsupported.go delete.go exec.go export.go history.go image_delete.go info.go inspect.go kill.go list.go logs.go monitor.go pause.go rename.go resize.go restart.go start.go state.go stats.go stats_collector_unix.go stop.go top.go unpause.go utils_nounix.go volumes.go wait.go
Directories ¶
- Version
- v1.8.0-rc3
- Published
- Aug 7, 2015
- Platform
- js/wasm
- Imports
- 84 packages
- Last checked
- 10 minutes ago –
Tools for package owners.