package daemon
import "github.com/dotcloud/docker/daemon"
Index ¶
- Constants
- Variables
- func GetFullContainerName(name string) (string, error)
- type BindMap
- type Container
- func (container *Container) Changes() ([]archive.Change, error)
- func (container *Container) Copy(resource string) (io.ReadCloser, error)
- func (container *Container) DisableLink(name string)
- 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) FromDisk() error
- func (container *Container) GetImage() (*image.Image, error)
- func (container *Container) GetMountLabel() string
- func (container *Container) GetProcessLabel() string
- func (container *Container) GetPtyMaster() (*os.File, 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 (container *Container) Mount() error
- func (container *Container) Output() (output []byte, err error)
- func (container *Container) Pause() error
- func (container *Container) ReadLog(name string) (io.Reader, error)
- 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) StderrLogPipe() io.ReadCloser
- func (container *Container) StderrPipe() (io.ReadCloser, error)
- func (container *Container) StdinPipe() (io.WriteCloser, error)
- func (container *Container) StdoutLogPipe() io.ReadCloser
- func (container *Container) StdoutPipe() (io.ReadCloser, error)
- func (container *Container) Stop(seconds int) error
- func (container *Container) ToDisk() error
- func (container *Container) Unmount() error
- func (container *Container) Unpause() error
- func (container *Container) Wait() int
- func (container *Container) WaitTimeout(timeout time.Duration) error
- func (container *Container) WriteHostConfig() error
- type Daemon
- func NewDaemon(config *daemonconfig.Config, eng *engine.Engine) (*Daemon, error)
- func NewDaemonFromDirectory(config *daemonconfig.Config, eng *engine.Engine) (*Daemon, error)
- func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinCloser io.Closer, stdout io.Writer, stderr io.Writer) chan error
- func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error)
- func (daemon *Daemon) Children(name string) (map[string]*Container, error)
- func (daemon *Daemon) Close() error
- func (daemon *Daemon) Commit(container *Container, repository, tag, comment, author string, config *runconfig.Config) (*image.Image, error)
- func (daemon *Daemon) Config() *daemonconfig.Config
- func (daemon *Daemon) ContainerGraph() *graphdb.Database
- func (daemon *Daemon) ContainerInspect(job *engine.Job) engine.Status
- func (daemon *Daemon) Create(config *runconfig.Config, name string) (*Container, []string, error)
- func (daemon *Daemon) Destroy(container *Container) error
- func (daemon *Daemon) Diff(container *Container) (archive.Archive, error)
- func (daemon *Daemon) ExecutionDriver() execdriver.Driver
- func (daemon *Daemon) Exists(id string) bool
- func (daemon *Daemon) Get(name string) *Container
- func (daemon *Daemon) GetByName(name string) (*Container, error)
- func (daemon *Daemon) Graph() *graph.Graph
- func (daemon *Daemon) GraphDriver() graphdriver.Driver
- func (daemon *Daemon) Install(eng *engine.Engine) error
- func (daemon *Daemon) Kill(c *Container, sig int) error
- func (daemon *Daemon) List() []*Container
- func (daemon *Daemon) LogToDisk(src *utils.WriteBroadcaster, dst, stream string) error
- func (daemon *Daemon) Mount(container *Container) error
- func (daemon *Daemon) Nuke() error
- func (daemon *Daemon) Pause(c *Container) 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) (int, error)
- func (daemon *Daemon) SetServer(server Server)
- func (daemon *Daemon) SystemConfig() *sysinfo.SysInfo
- func (daemon *Daemon) SystemInitPath() string
- func (daemon *Daemon) Unmount(container *Container) error
- func (daemon *Daemon) Unpause(c *Container) error
- func (daemon *Daemon) Volumes() *graph.Graph
- 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 NetworkSettings
- type PortMapping
- type Server
- type State
Constants ¶
const DefaultPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
const MaxImageDepth = 127
Set the max depth to the aufs default that most kernels are compiled with For more information see: http://sourceforge.net/p/aufs/aufs3-standalone/ci/aufs3.12/tree/config.mk
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 ( DefaultDns = []string{"8.8.8.8", "8.8.4.4"} )
Functions ¶
func GetFullContainerName ¶
Types ¶
type BindMap ¶
type Container ¶
type Container struct { sync.Mutex ID string Created time.Time Path string Args []string Config *runconfig.Config State State Image string NetworkSettings *NetworkSettings ResolvConfPath string HostnamePath string HostsPath string Name string Driver string ExecDriver string MountLabel, ProcessLabel string Volumes map[string]string // Store rw/ro in a separate structure to preserve reverse-compatibility on-disk. // Easier than migrating older container configs :) VolumesRW map[string]bool // contains filtered or unexported fields }
func (*Container) Changes ¶
func (*Container) Copy ¶
func (container *Container) Copy(resource string) (io.ReadCloser, error)
func (*Container) DisableLink ¶
func (*Container) Export ¶
func (*Container) ExportRw ¶
func (*Container) Exposes ¶
Returns true if the container exposes a certain port
func (*Container) FromDisk ¶
func (*Container) GetImage ¶
func (*Container) GetMountLabel ¶
func (*Container) GetProcessLabel ¶
func (*Container) GetPtyMaster ¶
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) Mount ¶
func (*Container) Output ¶
func (*Container) Pause ¶
func (*Container) ReadLog ¶
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) StderrLogPipe ¶
func (container *Container) StderrLogPipe() io.ReadCloser
func (*Container) StderrPipe ¶
func (container *Container) StderrPipe() (io.ReadCloser, error)
func (*Container) StdinPipe ¶
func (container *Container) StdinPipe() (io.WriteCloser, error)
func (*Container) StdoutLogPipe ¶
func (container *Container) StdoutLogPipe() io.ReadCloser
func (*Container) StdoutPipe ¶
func (container *Container) StdoutPipe() (io.ReadCloser, error)
func (*Container) Stop ¶
func (*Container) ToDisk ¶
func (*Container) Unmount ¶
func (*Container) Unpause ¶
func (*Container) Wait ¶
Wait blocks until the container stops running, then returns its exit code.
func (*Container) WaitTimeout ¶
func (*Container) WriteHostConfig ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
func NewDaemon ¶
FIXME: harmonize with NewGraph()
func NewDaemonFromDirectory ¶
func (*Daemon) Attach ¶
func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinCloser io.Closer, stdout io.Writer, stderr io.Writer) chan error
func (*Daemon) Changes ¶
func (*Daemon) Children ¶
func (*Daemon) Close ¶
func (*Daemon) Commit ¶
func (daemon *Daemon) Commit(container *Container, repository, tag, comment, author string, config *runconfig.Config) (*image.Image, error)
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() *daemonconfig.Config
func (*Daemon) ContainerGraph ¶
func (*Daemon) ContainerInspect ¶
func (*Daemon) Create ¶
Create creates a new container from the given configuration with a given name.
func (*Daemon) Destroy ¶
Destroy unregisters a container from the daemon and cleanly removes its contents from the filesystem.
func (*Daemon) Diff ¶
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) Get ¶
Get looks for a container by the specified ID or name, and returns it. If the container is not found, or if an error occurs, nil 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) Install ¶
Install installs daemon capabilities to eng.
func (*Daemon) Kill ¶
func (*Daemon) List ¶
List returns an array of all containers registered in the daemon.
func (*Daemon) LogToDisk ¶
func (daemon *Daemon) LogToDisk(src *utils.WriteBroadcaster, dst, stream string) error
func (*Daemon) Mount ¶
func (*Daemon) Nuke ¶
Nuke kills all containers then removes all content from the content root, including images, volumes and container filesystems. Again: this will remove your entire docker daemon!
func (*Daemon) Pause ¶
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) (int, error)
func (*Daemon) SetServer ¶
func (*Daemon) SystemConfig ¶
func (*Daemon) SystemInitPath ¶
func (*Daemon) Unmount ¶
func (*Daemon) Unpause ¶
func (*Daemon) Volumes ¶
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 NetworkSettings ¶
type NetworkSettings struct { IPAddress string IPPrefixLen int Gateway string Bridge string PortMapping map[string]PortMapping // Deprecated Ports nat.PortMap }
func (*NetworkSettings) PortMappingAPI ¶
func (settings *NetworkSettings) PortMappingAPI() *engine.Table
type PortMapping ¶
FIXME: move deprecated port stuff to nat to clean up the core.
type Server ¶
type Server interface { LogEvent(action, id, from string) *utils.JSONMessage IsRunning() bool // returns true if the server is currently in operation }
type State ¶
type State struct { sync.RWMutex Running bool Paused bool Pid int ExitCode int StartedAt time.Time FinishedAt time.Time }
func (*State) GetExitCode ¶
func (*State) IsPaused ¶
func (*State) IsRunning ¶
func (*State) SetPaused ¶
func (s *State) SetPaused()
func (*State) SetRunning ¶
func (*State) SetStopped ¶
func (*State) SetUnpaused ¶
func (s *State) SetUnpaused()
func (*State) String ¶
String returns a human-readable description of the state
Source Files ¶
attach.go container.go daemon.go daemon_aufs.go daemon_btrfs.go daemon_devicemapper.go history.go inspect.go network_settings.go server.go state.go utils.go volumes.go
Directories ¶
Path | Synopsis |
---|---|
daemon/execdriver | |
daemon/execdriver/execdrivers | |
daemon/execdriver/lxc | |
daemon/execdriver/native | These types are wrappers around the libcontainer Terminal interface so that we can resuse the docker implementations where possible. |
daemon/execdriver/native/configuration | |
daemon/execdriver/native/template | |
daemon/graphdriver | |
daemon/graphdriver/aufs | |
daemon/graphdriver/btrfs | |
daemon/graphdriver/devmapper | |
daemon/graphdriver/graphtest | |
daemon/graphdriver/vfs | |
daemon/networkdriver | |
daemon/networkdriver/bridge | |
daemon/networkdriver/ipallocator | |
daemon/networkdriver/portallocator | |
daemon/networkdriver/portmapper |
- Version
- v1.0.1
- Published
- Jun 19, 2014
- Platform
- js/wasm
- Imports
- 45 packages
- Last checked
- 3 minutes ago –
Tools for package owners.