package docker
import "github.com/docker/docker"
Index ¶
- Constants
- Variables
- func BtrfsReflink(fd_out, fd_in uintptr) error
- func CompareConfig(a, b *Config) bool
- func CopyFile(dstFile, srcFile *os.File) error
- func CreateBridgeIface(config *DaemonConfig) error
- func GenerateID() string
- func ListenAndServe(proto, addr string, srv *Server, logging bool) error
- func MergeConfig(userConf, imageConf *Config) error
- func MkBuildContext(dockerfile string, files [][2]string) (archive.Archive, error)
- func ParseCommands(proto, addr string, args ...string) error
- func ParseRun(args []string, capabilities *Capabilities) (*Config, *HostConfig, *flag.FlagSet, error)
- func PrintTreeNode(cli *DockerCli, noTrunc *bool, image APIImages, prefix string)
- func RootIsShared() bool
- func ServeRequest(srv *Server, apiversion float64, w http.ResponseWriter, req *http.Request) error
- func StoreImage(img *Image, jsonData []byte, layerData archive.Archive, root, rootfs string) error
- func Subcmd(name, signature, description string) *flag.FlagSet
- func TestJsonContentType(t *testing.T)
- func ValidateID(id string) error
- func WalkTree(cli *DockerCli, noTrunc *bool, images []APIImages, byParent map[string][]APIImages, prefix string)
- type APIAuth
- type APIContainers
- type APIContainersOld
- type APICopy
- type APIHistory
- type APIID
- type APIImageConfig
- type APIImages
- type APIImagesOld
- type APIInfo
- type APIPort
- type APIRmi
- type APIRun
- type APITop
- type APIVersion
- type APIWait
- type AttachOpts
- func NewAttachOpts() AttachOpts
- func (opts AttachOpts) Get(val string) bool
- func (opts AttachOpts) Set(val string) error
- func (opts AttachOpts) String() string
- type BindMap
- type BuildFile
- type Capabilities
- type Change
- type Config
- type Container
- func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, stdout io.Writer, stderr io.Writer) chan error
- func (container *Container) Changes() ([]archive.Change, error)
- func (container *Container) Cmd() *exec.Cmd
- func (container *Container) Copy(resource string) (archive.Archive, error)
- func (container *Container) EnsureMounted() error
- func (container *Container) EnvConfigPath() string
- func (container *Container) Export() (archive.Archive, error)
- func (container *Container) ExportRw() (archive.Archive, error)
- func (container *Container) Exposes(p Port) bool
- func (container *Container) FromDisk() error
- func (container *Container) GetImage() (*Image, error)
- func (container *Container) GetSize() (int64, int64)
- func (container *Container) Inject(file io.Reader, pth string) error
- func (container *Container) Kill() error
- func (container *Container) Mount() error
- func (container *Container) Output() (output []byte, err 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) Start() (err error)
- func (container *Container) StderrPipe() (io.ReadCloser, error)
- func (container *Container) StdinPipe() (io.WriteCloser, error)
- func (container *Container) StdoutPipe() (io.ReadCloser, error)
- func (container *Container) Stop(seconds int) error
- func (container *Container) ToDisk() (err error)
- func (container *Container) Unmount() error
- func (container *Container) Wait() int
- func (container *Container) WaitTimeout(timeout time.Duration) error
- func (container *Container) When() time.Time
- type DaemonConfig
- type DockerCli
- func NewDockerCli(in io.ReadCloser, out, err io.Writer, proto, addr string) *DockerCli
- func (cli *DockerCli) CmdAttach(args ...string) error
- func (cli *DockerCli) CmdBuild(args ...string) error
- func (cli *DockerCli) CmdCommit(args ...string) error
- func (cli *DockerCli) CmdCp(args ...string) error
- func (cli *DockerCli) CmdDiff(args ...string) error
- func (cli *DockerCli) CmdEvents(args ...string) error
- func (cli *DockerCli) CmdExport(args ...string) error
- func (cli *DockerCli) CmdHelp(args ...string) error
- func (cli *DockerCli) CmdHistory(args ...string) error
- func (cli *DockerCli) CmdImages(args ...string) error
- func (cli *DockerCli) CmdImport(args ...string) error
- func (cli *DockerCli) CmdInfo(args ...string) error
- func (cli *DockerCli) CmdInsert(args ...string) error
- func (cli *DockerCli) CmdInspect(args ...string) error
- func (cli *DockerCli) CmdKill(args ...string) error
- func (cli *DockerCli) CmdLogin(args ...string) error
- func (cli *DockerCli) CmdLogs(args ...string) error
- func (cli *DockerCli) CmdPort(args ...string) error
- func (cli *DockerCli) CmdPs(args ...string) error
- func (cli *DockerCli) CmdPull(args ...string) error
- func (cli *DockerCli) CmdPush(args ...string) error
- func (cli *DockerCli) CmdRestart(args ...string) error
- func (cli *DockerCli) CmdRm(args ...string) error
- func (cli *DockerCli) CmdRmi(args ...string) error
- func (cli *DockerCli) CmdRun(args ...string) error
- func (cli *DockerCli) CmdSearch(args ...string) error
- func (cli *DockerCli) CmdStart(args ...string) error
- func (cli *DockerCli) CmdStop(args ...string) error
- func (cli *DockerCli) CmdTag(args ...string) error
- func (cli *DockerCli) CmdTop(args ...string) error
- func (cli *DockerCli) CmdVersion(args ...string) error
- func (cli *DockerCli) CmdWait(args ...string) error
- func (cli *DockerCli) LoadConfigFile() (err error)
- type Graph
- func NewGraph(root string, driver graphdriver.Driver) (*Graph, error)
- func (graph *Graph) ByParent() (map[string][]*Image, error)
- func (graph *Graph) Create(layerData archive.Archive, container *Container, comment, author string, config *Config) (*Image, error)
- func (graph *Graph) Delete(name string) error
- func (graph *Graph) Exists(id string) bool
- func (graph *Graph) Get(name string) (*Image, error)
- func (graph *Graph) Heads() (map[string]*Image, error)
- func (graph *Graph) IsNotExist(err error) bool
- func (graph *Graph) Map() (map[string]*Image, error)
- func (graph *Graph) Mktemp(id string) (string, error)
- func (graph *Graph) Register(jsonData []byte, layerData archive.Archive, img *Image) error
- func (graph *Graph) TempLayerArchive(id string, compression archive.Compression, sf *utils.StreamFormatter, output io.Writer) (*archive.TempArchive, error)
- type History
- func (history *History) Add(container *Container)
- func (history *History) Len() int
- func (history *History) Less(i, j int) bool
- func (history *History) Swap(i, j int)
- type HostConfig
- type HttpApiFunc
- type IPAllocator
- func (alloc *IPAllocator) Acquire() (net.IP, error)
- func (alloc *IPAllocator) Close() error
- func (alloc *IPAllocator) Release(ip net.IP)
- type Image
- func LoadImage(root string) (*Image, error)
- func NewImgJSON(src []byte) (*Image, error)
- func (img *Image) Depth() (int, error)
- func (img *Image) GetParent() (*Image, error)
- func (img *Image) History() ([]*Image, error)
- func (img *Image) SaveSize(root string) error
- func (img *Image) TarLayer(compression archive.Compression) (archive.Archive, error)
- func (img *Image) WalkHistory(handler func(*Image) error) (err error)
- type KeyValuePair
- type Link
- func NewLink(parent, child *Container, name, bridgeInterface string) (*Link, error)
- func (l *Link) Alias() string
- func (l *Link) Disable()
- func (l *Link) Enable() error
- func (l *Link) ToEnv() []string
- type Nat
- type NetworkInterface
- func (iface *NetworkInterface) AllocatePort(port Port, binding PortBinding) (*Nat, error)
- func (iface *NetworkInterface) Release()
- type NetworkManager
- func (manager *NetworkManager) Allocate() (*NetworkInterface, error)
- func (manager *NetworkManager) Close() error
- type NetworkSettings
- type PathOpts
- func NewPathOpts() PathOpts
- func (opts PathOpts) Set(val string) error
- func (opts PathOpts) String() string
- type Port
- func NewPort(proto, port string) Port
- func (p Port) Int() int
- func (p Port) Port() string
- func (p Port) Proto() string
- type PortAllocator
- func (alloc *PortAllocator) Acquire(port int) (int, error)
- func (alloc *PortAllocator) Close() error
- func (alloc *PortAllocator) Release(port int) error
- type PortBinding
- type PortMapper
- func (mapper *PortMapper) Map(ip net.IP, port int, backendAddr net.Addr) error
- func (mapper *PortMapper) Unmap(ip net.IP, port int, proto string) error
- type PortMapping
- type Repository
- type Runtime
- func NewRuntime(config *DaemonConfig) (*Runtime, error)
- func NewRuntimeFromDirectory(config *DaemonConfig) (*Runtime, error)
- func (runtime *Runtime) Changes(container *Container) ([]archive.Change, error)
- func (runtime *Runtime) Children(name string) (map[string]*Container, error)
- func (runtime *Runtime) Close() error
- func (runtime *Runtime) Commit(container *Container, repository, tag, comment, author string, config *Config) (*Image, error)
- func (runtime *Runtime) Create(config *Config, name string) (*Container, []string, error)
- func (runtime *Runtime) Destroy(container *Container) error
- func (runtime *Runtime) Diff(container *Container) (archive.Archive, error)
- func (runtime *Runtime) Exists(id string) bool
- func (runtime *Runtime) Get(name string) *Container
- func (runtime *Runtime) GetByName(name string) (*Container, error)
- func (runtime *Runtime) Graph() *Graph
- func (runtime *Runtime) List() []*Container
- func (runtime *Runtime) LogToDisk(src *utils.WriteBroadcaster, dst, stream string) error
- func (runtime *Runtime) Mount(container *Container) error
- func (runtime *Runtime) Nuke() error
- func (runtime *Runtime) Register(container *Container) error
- func (runtime *Runtime) RegisterLink(parent, child *Container, alias string) error
- func (runtime *Runtime) Unmount(container *Container) error
- func (runtime *Runtime) UpdateCapabilities(quiet bool)
- type Server
- func NewServer(eng *engine.Engine, config *DaemonConfig) (*Server, error)
- func (srv *Server) Close() error
- func (srv *Server) ContainerAttach(name string, logs, stream, stdin, stdout, stderr bool, inStream io.ReadCloser, outStream, errStream io.Writer) error
- func (srv *Server) ContainerChanges(name string) ([]archive.Change, error)
- func (srv *Server) ContainerCommit(name, repo, tag, author, comment string, config *Config) (string, error)
- func (srv *Server) ContainerCopy(name string, resource string, out io.Writer) error
- func (srv *Server) ContainerCreate(job *engine.Job) string
- func (srv *Server) ContainerDestroy(name string, removeVolume, removeLink bool) error
- func (srv *Server) ContainerExport(name string, out io.Writer) error
- func (srv *Server) ContainerInspect(name string) (*Container, error)
- func (srv *Server) ContainerKill(name string, sig int) error
- func (srv *Server) ContainerResize(name string, h, w int) error
- func (srv *Server) ContainerRestart(name string, t int) error
- func (srv *Server) ContainerStart(job *engine.Job) string
- func (srv *Server) ContainerStop(name string, t int) error
- func (srv *Server) ContainerTag(name, repo, tag string, force bool) error
- func (srv *Server) ContainerTop(name, psArgs string) (*APITop, error)
- func (srv *Server) ContainerWait(name string) (int, error)
- func (srv *Server) Containers(all, size bool, n int, since, before string) []APIContainers
- func (srv *Server) DockerInfo() *APIInfo
- func (srv *Server) DockerVersion() APIVersion
- func (srv *Server) HTTPRequestFactory(metaHeaders map[string][]string) *utils.HTTPRequestFactory
- func (srv *Server) ImageDelete(name string, autoPrune bool) ([]APIRmi, error)
- func (srv *Server) ImageGetCached(imgID string, config *Config) (*Image, error)
- func (srv *Server) ImageHistory(name string) ([]APIHistory, error)
- func (srv *Server) ImageImport(src, repo, tag string, in io.Reader, out io.Writer, sf *utils.StreamFormatter) error
- func (srv *Server) ImageInsert(name, url, path string, out io.Writer, sf *utils.StreamFormatter) error
- func (srv *Server) ImageInspect(name string) (*Image, error)
- func (srv *Server) ImagePull(localName string, tag string, out io.Writer, sf *utils.StreamFormatter, authConfig *auth.AuthConfig, metaHeaders map[string][]string, parallel bool) error
- func (srv *Server) ImagePush(localName string, out io.Writer, sf *utils.StreamFormatter, authConfig *auth.AuthConfig, metaHeaders map[string][]string) error
- func (srv *Server) Images(all bool, filter string) ([]APIImages, error)
- func (srv *Server) ImagesSearch(term string) ([]registry.SearchResult, error)
- func (srv *Server) ImagesViz(out io.Writer) error
- func (srv *Server) ListenAndServe(job *engine.Job) string
- func (srv *Server) LogEvent(action, id, from string) *utils.JSONMessage
- func (srv *Server) RegisterLinks(name string, hostConfig *HostConfig) error
- type State
- type TagStore
- func NewTagStore(path string, graph *Graph) (*TagStore, error)
- func (store *TagStore) ByID() map[string][]string
- func (store *TagStore) Delete(repoName, tag string) (bool, error)
- func (store *TagStore) DeleteAll(id string) error
- func (store *TagStore) Get(repoName string) (Repository, error)
- func (store *TagStore) GetImage(repoName, tagOrID string) (*Image, error)
- func (store *TagStore) ImageName(id string) string
- func (store *TagStore) LookupImage(name string) (*Image, error)
- func (store *TagStore) Reload() error
- func (store *TagStore) Save() error
- func (store *TagStore) Set(repoName, tag, imageName string, force bool) error
Constants ¶
const ( APIVERSION = 1.7 DEFAULTHTTPHOST = "127.0.0.1" DEFAULTHTTPPORT = 4243 DEFAULTUNIXSOCKET = "/var/run/docker.sock" )
const ( DefaultNetworkBridge = "docker0" DisableNetworkBridge = "none" )
const DEFAULTTAG = "latest"
const LxcTemplate = "" /* 4410 byte string literal not displayed */
const MaxImageDepth = 42
Set the max depth to the aufs restriction
Variables ¶
var ( ErrContainerStart = errors.New("The container failed to start. Unkown error") ErrContainerStartTimeout = errors.New("The container failed to start due to timed out.") ErrInvalidWorikingDirectory = errors.New("The working directory is invalid. It needs to be an absolute path.") ErrConflictAttachDetach = errors.New("Conflicting options: -a and -d") ErrConflictDetachAutoRemove = errors.New("Conflicting options: -rm and -d") )
var ( ErrConnectionRefused = errors.New("Can't connect to docker daemon. Is 'docker -d' running on this host?") )
Functions ¶
func BtrfsReflink ¶
func CompareConfig ¶
Compare two Config struct. Do not compare the "Image" nor "Hostname" fields If OpenStdin is set, then it differs
func CopyFile ¶
func CreateBridgeIface ¶
func CreateBridgeIface(config *DaemonConfig) error
CreateBridgeIface creates a network bridge interface on the host system with the name `ifaceName`, and attempts to configure it with an address which doesn't conflict with any other interface on the host. If it can't find an address which doesn't conflict, it will return an error.
func GenerateID ¶
func GenerateID() string
func ListenAndServe ¶
func MergeConfig ¶
func MkBuildContext ¶
mkBuildContext returns an archive of an empty context with the contents of `dockerfile` at the path ./Dockerfile
func ParseCommands ¶
func ParseRun ¶
func ParseRun(args []string, capabilities *Capabilities) (*Config, *HostConfig, *flag.FlagSet, error)
func PrintTreeNode ¶
func RootIsShared ¶
func RootIsShared() bool
func ServeRequest ¶
ServeRequest processes a single http request to the docker remote api. FIXME: refactor this to be part of Server and not require re-creating a new router each time. This requires first moving ListenAndServe into Server.
func StoreImage ¶
func Subcmd ¶
func TestJsonContentType ¶
func ValidateID ¶
func WalkTree ¶
func WalkTree(cli *DockerCli, noTrunc *bool, images []APIImages, byParent map[string][]APIImages, prefix string)
Types ¶
type APIAuth ¶
type APIAuth struct { Status string }
type APIContainers ¶
type APIContainers struct { ID string `json:"Id"` Image string Command string Created int64 Status string Ports []APIPort SizeRw int64 SizeRootFs int64 Names []string }
func (APIContainers) ToLegacy ¶
func (api APIContainers) ToLegacy() *APIContainersOld
type APIContainersOld ¶
type APIContainersOld struct { ID string `json:"Id"` Image string Command string Created int64 Status string Ports string SizeRw int64 SizeRootFs int64 }
type APICopy ¶
type APIHistory ¶
type APIHistory struct { ID string `json:"Id"` Tags []string `json:",omitempty"` Created int64 CreatedBy string `json:",omitempty"` Size int64 }
type APIID ¶
type APIID struct { ID string `json:"Id"` }
type APIImageConfig ¶
type APIImages ¶
type APIImages struct { ID string `json:"Id"` RepoTags []string `json:",omitempty"` Created int64 Size int64 VirtualSize int64 ParentId string `json:",omitempty"` }
func (APIImages) ToLegacy ¶
func (api APIImages) ToLegacy() []APIImagesOld
type APIImagesOld ¶
type APIImagesOld struct { Repository string `json:",omitempty"` Tag string `json:",omitempty"` ID string `json:"Id"` Created int64 Size int64 VirtualSize int64 }
type APIInfo ¶
type APIInfo struct { Debug bool Containers int Images int Driver string `json:",omitempty"` DriverStatus [][2]string `json:",omitempty"` NFd int `json:",omitempty"` NGoroutines int `json:",omitempty"` MemoryLimit bool `json:",omitempty"` SwapLimit bool `json:",omitempty"` IPv4Forwarding bool `json:",omitempty"` LXCVersion string `json:",omitempty"` NEventsListener int `json:",omitempty"` KernelVersion string `json:",omitempty"` IndexServerAddress string `json:",omitempty"` }
type APIPort ¶
type APIRmi ¶
type APIRun ¶
type APITop ¶
type APIVersion ¶
type APIVersion struct { Version string GitCommit string `json:",omitempty"` GoVersion string `json:",omitempty"` }
type APIWait ¶
type APIWait struct { StatusCode int }
type AttachOpts ¶
AttachOpts stores arguments to 'docker run -a', eg. which streams to attach to
func NewAttachOpts ¶
func NewAttachOpts() AttachOpts
func (AttachOpts) Get ¶
func (opts AttachOpts) Get(val string) bool
func (AttachOpts) Set ¶
func (opts AttachOpts) Set(val string) error
func (AttachOpts) String ¶
func (opts AttachOpts) String() string
type BindMap ¶
type BuildFile ¶
type BuildFile interface { Build(io.Reader) (string, error) CmdFrom(string) error CmdRun(string) error }
func NewBuildFile ¶
type Capabilities ¶
type Capabilities struct { MemoryLimit bool SwapLimit bool IPv4ForwardingDisabled bool AppArmor bool }
type Change ¶
type Config ¶
type Config struct { Hostname string Domainname string User string Memory int64 // Memory limit (in bytes) MemorySwap int64 // Total memory usage (memory + swap); set `-1' to disable swap int64 // CPU shares (relative weight vs. other containers) AttachStdin bool AttachStdout bool AttachStderr bool PortSpecs []string // Deprecated - Can be in the format of 8080/tcp ExposedPorts map[Port]struct{} Tty bool // Attach standard streams to a tty, including stdin if it is not closed. OpenStdin bool // Open stdin StdinOnce bool // If true, close stdin after the 1 attached client disconnects. Env []string Cmd []string Dns []string Image string // Name of the image as it was passed by the operator (eg. could be symbolic) Volumes map[string]struct{} VolumesFrom string WorkingDir string Entrypoint []string NetworkDisabled bool }
Note: the Config structure should hold only portable information about the container. Here, "portable" means "independent from the host we are running on". Non-portable information *should* appear in HostConfig.
type Container ¶
type Container struct { ID string Created time.Time Path string Args []string Config *Config State State Image string NetworkSettings *NetworkSettings SysInitPath string ResolvConfPath string HostnamePath string HostsPath string Name string Driver 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) Attach ¶
func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, stdout io.Writer, stderr io.Writer) chan error
func (*Container) Changes ¶
func (*Container) Cmd ¶
func (*Container) Copy ¶
func (*Container) EnsureMounted ¶
func (*Container) EnvConfigPath ¶
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) GetSize ¶
GetSize, return real size, virtual size
func (*Container) Inject ¶
Inject the io.Reader at the given path. Note: do not close the reader
func (*Container) Kill ¶
func (*Container) Mount ¶
func (*Container) Output ¶
func (*Container) ReadLog ¶
func (*Container) Resize ¶
func (*Container) Restart ¶
func (*Container) RootfsPath ¶
This method must be exported to be used from the lxc template
func (*Container) Run ¶
func (*Container) Start ¶
func (*Container) StderrPipe ¶
func (container *Container) StderrPipe() (io.ReadCloser, error)
func (*Container) StdinPipe ¶
func (container *Container) StdinPipe() (io.WriteCloser, error)
func (*Container) StdoutPipe ¶
func (container *Container) StdoutPipe() (io.ReadCloser, error)
func (*Container) Stop ¶
func (*Container) ToDisk ¶
func (*Container) Unmount ¶
func (*Container) Wait ¶
Wait blocks until the container stops running, then returns its exit code.
func (*Container) WaitTimeout ¶
func (*Container) When ¶
type DaemonConfig ¶
type DaemonConfig struct { Pidfile string Root string AutoRestart bool EnableCors bool Dns []string EnableIptables bool BridgeIface string DefaultIp net.IP InterContainerCommunication bool GraphDriver string }
FIXME: separate runtime configuration from http api configuration
func ConfigFromJob ¶
func ConfigFromJob(job *engine.Job) *DaemonConfig
ConfigFromJob creates and returns a new DaemonConfig object by parsing the contents of a job's environment.
type DockerCli ¶
type DockerCli struct {
// contains filtered or unexported fields
}
func NewDockerCli ¶
func (*DockerCli) CmdAttach ¶
func (*DockerCli) CmdBuild ¶
func (*DockerCli) CmdCommit ¶
func (*DockerCli) CmdCp ¶
func (*DockerCli) CmdDiff ¶
func (*DockerCli) CmdEvents ¶
func (*DockerCli) CmdExport ¶
func (*DockerCli) CmdHelp ¶
func (*DockerCli) CmdHistory ¶
func (*DockerCli) CmdImages ¶
func (*DockerCli) CmdImport ¶
func (*DockerCli) CmdInfo ¶
'docker info': display system-wide information.
func (*DockerCli) CmdInsert ¶
func (*DockerCli) CmdInspect ¶
func (*DockerCli) CmdKill ¶
'docker kill NAME' kills a running container
func (*DockerCli) CmdLogin ¶
'docker login': login / register a user to registry service.
func (*DockerCli) CmdLogs ¶
func (*DockerCli) CmdPort ¶
func (*DockerCli) CmdPs ¶
func (*DockerCli) CmdPull ¶
func (*DockerCli) CmdPush ¶
func (*DockerCli) CmdRestart ¶
func (*DockerCli) CmdRm ¶
func (*DockerCli) CmdRmi ¶
'docker rmi IMAGE' removes all images with the name IMAGE
func (*DockerCli) CmdRun ¶
func (*DockerCli) CmdSearch ¶
func (*DockerCli) CmdStart ¶
func (*DockerCli) CmdStop ¶
func (*DockerCli) CmdTag ¶
func (*DockerCli) CmdTop ¶
func (*DockerCli) CmdVersion ¶
'docker version': show version information
func (*DockerCli) CmdWait ¶
'docker wait': block until a container stops
func (*DockerCli) LoadConfigFile ¶
type Graph ¶
type Graph struct { Root string // contains filtered or unexported fields }
A Graph is a store for versioned filesystem images and the relationship between them.
func NewGraph ¶
func NewGraph(root string, driver graphdriver.Driver) (*Graph, error)
NewGraph instantiates a new graph at the given root path in the filesystem. `root` will be created if it doesn't exist.
func (*Graph) ByParent ¶
ByParent returns a lookup table of images by their parent. If an image of id ID has 3 children images, then the value for key ID will be a list of 3 images. If an image has no children, it will not have an entry in the table.
func (*Graph) Create ¶
func (graph *Graph) Create(layerData archive.Archive, container *Container, comment, author string, config *Config) (*Image, error)
Create creates a new image and registers it in the graph.
func (*Graph) Delete ¶
Delete atomically removes an image from the graph.
func (*Graph) Exists ¶
Exists returns true if an image is registered at the given id. If the image doesn't exist or if an error is encountered, false is returned.
func (*Graph) Get ¶
Get returns the image with the given id, or an error if the image doesn't exist.
func (*Graph) Heads ¶
Heads returns all heads in the graph, keyed by id. A head is an image which is not the parent of another image in the graph.
func (*Graph) IsNotExist ¶
FIXME: Implement error subclass instead of looking at the error text Note: This is the way golang implements os.IsNotExists on Plan9
func (*Graph) Map ¶
Map returns a list of all images in the graph, addressable by ID.
func (*Graph) Mktemp ¶
Mktemp creates a temporary sub-directory inside the graph's filesystem.
func (*Graph) Register ¶
Register imports a pre-existing image into the graph. FIXME: pass img as first argument
func (*Graph) TempLayerArchive ¶
func (graph *Graph) TempLayerArchive(id string, compression archive.Compression, sf *utils.StreamFormatter, output io.Writer) (*archive.TempArchive, error)
TempLayerArchive creates a temporary archive of the given image's filesystem layer.
The archive is stored on disk and will be automatically deleted as soon as has been read. If output is not nil, a human-readable progress bar will be written to it. FIXME: does this belong in Graph? How about MktempFile, let the caller use it for archives?
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) Swap ¶
type HostConfig ¶
type HostConfig struct { Binds []string ContainerIDFile string LxcConf []KeyValuePair Privileged bool PortBindings map[Port][]PortBinding Links []string PublishAllPorts bool }
type HttpApiFunc ¶
type HttpApiFunc func(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error
type IPAllocator ¶
type IPAllocator struct {
// contains filtered or unexported fields
}
IP allocator: Automatically allocate and release networking ports
func (*IPAllocator) Acquire ¶
func (alloc *IPAllocator) Acquire() (net.IP, error)
func (*IPAllocator) Close ¶
func (alloc *IPAllocator) Close() error
func (*IPAllocator) Release ¶
func (alloc *IPAllocator) Release(ip net.IP)
type Image ¶
type Image struct { ID string `json:"id"` Parent string `json:"parent,omitempty"` Comment string `json:"comment,omitempty"` Created time.Time `json:"created"` Container string `json:"container,omitempty"` ContainerConfig Config `json:"container_config,omitempty"` DockerVersion string `json:"docker_version,omitempty"` Author string `json:"author,omitempty"` Config *Config `json:"config,omitempty"` Architecture string `json:"architecture,omitempty"` Size int64 // contains filtered or unexported fields }
func LoadImage ¶
func NewImgJSON ¶
Build an Image object from raw json data
func (*Image) Depth ¶
Depth returns the number of parents for a current image
func (*Image) GetParent ¶
func (*Image) History ¶
Image includes convenience proxy functions to its graph These functions will return an error if the image is not registered (ie. if image.graph == nil)
func (*Image) SaveSize ¶
SaveSize stores the current `size` value of `img` in the directory `root`.
func (*Image) TarLayer ¶
TarLayer returns a tar archive of the image's filesystem layer.
func (*Image) WalkHistory ¶
type KeyValuePair ¶
type Link ¶
type Link struct { ParentIP string ChildIP string Name string BridgeInterface string ChildEnvironment []string Ports []Port IsEnabled bool }
func NewLink ¶
func (*Link) Alias ¶
func (*Link) Disable ¶
func (l *Link) Disable()
func (*Link) Enable ¶
func (*Link) ToEnv ¶
type Nat ¶
type Nat struct { Port Port Binding PortBinding }
func (*Nat) String ¶
type NetworkInterface ¶
type NetworkInterface struct { IPNet net.IPNet Gateway net.IP // contains filtered or unexported fields }
Network interface represents the networking stack of a container
func (*NetworkInterface) AllocatePort ¶
func (iface *NetworkInterface) AllocatePort(port Port, binding PortBinding) (*Nat, error)
Allocate an external port and map it to the interface
func (*NetworkInterface) Release ¶
func (iface *NetworkInterface) Release()
Release: Network cleanup - release all resources
type NetworkManager ¶
type NetworkManager struct {
// contains filtered or unexported fields
}
Network Manager manages a set of network interfaces Only *one* manager per host machine should be used
func (*NetworkManager) Allocate ¶
func (manager *NetworkManager) Allocate() (*NetworkInterface, error)
Allocate a network interface
func (*NetworkManager) Close ¶
func (manager *NetworkManager) Close() error
type NetworkSettings ¶
type NetworkSettings struct { IPAddress string IPPrefixLen int Gateway string Bridge string PortMapping map[string]PortMapping // Deprecated Ports map[Port][]PortBinding }
func (*NetworkSettings) PortMappingAPI ¶
func (settings *NetworkSettings) PortMappingAPI() []APIPort
type PathOpts ¶
type PathOpts map[string]struct{}
PathOpts stores a unique set of absolute paths
func NewPathOpts ¶
func NewPathOpts() PathOpts
func (PathOpts) Set ¶
func (PathOpts) String ¶
type Port ¶
type Port string
80/tcp
func NewPort ¶
func (Port) Int ¶
func (Port) Port ¶
func (Port) Proto ¶
type PortAllocator ¶
Port allocator: Automatically allocate and release networking ports
func (*PortAllocator) Acquire ¶
func (alloc *PortAllocator) Acquire(port int) (int, error)
func (*PortAllocator) Close ¶
func (alloc *PortAllocator) Close() error
func (*PortAllocator) Release ¶
func (alloc *PortAllocator) Release(port int) error
FIXME: Release can no longer fail, change its prototype to reflect that.
type PortBinding ¶
type PortMapper ¶
type PortMapper struct {
// contains filtered or unexported fields
}
Port mapper takes care of mapping external ports to containers by setting up iptables rules. It keeps track of all mappings and is able to unmap at will
func (*PortMapper) Map ¶
func (*PortMapper) Unmap ¶
type PortMapping ¶
type Repository ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(config *DaemonConfig) (*Runtime, error)
FIXME: harmonize with NewGraph()
func NewRuntimeFromDirectory ¶
func NewRuntimeFromDirectory(config *DaemonConfig) (*Runtime, error)
func (*Runtime) Changes ¶
func (*Runtime) Children ¶
func (*Runtime) Close ¶
func (*Runtime) Commit ¶
func (runtime *Runtime) Commit(container *Container, repository, tag, comment, author string, config *Config) (*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 (*Runtime) Create ¶
Create creates a new container from the given configuration with a given name.
func (*Runtime) Destroy ¶
Destroy unregisters a container from the runtime and cleanly removes its contents from the filesystem.
func (*Runtime) Diff ¶
func (*Runtime) Exists ¶
Exists returns a true if a container of the specified ID or name exists, false otherwise.
func (*Runtime) 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 (*Runtime) GetByName ¶
func (*Runtime) Graph ¶
FIXME: this is a convenience function for integration tests which need direct access to runtime.graph. Once the tests switch to using engine and jobs, this method can go away.
func (*Runtime) List ¶
List returns an array of all containers registered in the runtime.
func (*Runtime) LogToDisk ¶
func (runtime *Runtime) LogToDisk(src *utils.WriteBroadcaster, dst, stream string) error
func (*Runtime) Mount ¶
func (*Runtime) 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 runtime!
func (*Runtime) Register ¶
Register makes a container object usable by the runtime as <container.ID>
func (*Runtime) RegisterLink ¶
func (*Runtime) Unmount ¶
func (*Runtime) UpdateCapabilities ¶
FIXME: comment please!
type Server ¶
func NewServer ¶
func NewServer(eng *engine.Engine, config *DaemonConfig) (*Server, error)
func (*Server) Close ¶
func (*Server) ContainerAttach ¶
func (srv *Server) ContainerAttach(name string, logs, stream, stdin, stdout, stderr bool, inStream io.ReadCloser, outStream, errStream io.Writer) error
func (*Server) ContainerChanges ¶
func (*Server) ContainerCommit ¶
func (srv *Server) ContainerCommit(name, repo, tag, author, comment string, config *Config) (string, error)
func (*Server) ContainerCopy ¶
func (*Server) ContainerCreate ¶
func (*Server) ContainerDestroy ¶
func (*Server) ContainerExport ¶
func (*Server) ContainerInspect ¶
func (*Server) 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 (*Server) ContainerResize ¶
func (*Server) ContainerRestart ¶
func (*Server) ContainerStart ¶
func (*Server) ContainerStop ¶
func (*Server) ContainerTag ¶
FIXME: this should be called ImageTag
func (*Server) ContainerTop ¶
func (*Server) ContainerWait ¶
func (*Server) Containers ¶
func (srv *Server) Containers(all, size bool, n int, since, before string) []APIContainers
func (*Server) DockerInfo ¶
func (*Server) DockerVersion ¶
func (srv *Server) DockerVersion() APIVersion
func (*Server) HTTPRequestFactory ¶
func (srv *Server) HTTPRequestFactory(metaHeaders map[string][]string) *utils.HTTPRequestFactory
func (*Server) ImageDelete ¶
func (*Server) ImageGetCached ¶
func (*Server) ImageHistory ¶
func (srv *Server) ImageHistory(name string) ([]APIHistory, error)
func (*Server) ImageImport ¶
func (srv *Server) ImageImport(src, repo, tag string, in io.Reader, out io.Writer, sf *utils.StreamFormatter) error
func (*Server) ImageInsert ¶
func (srv *Server) ImageInsert(name, url, path string, out io.Writer, sf *utils.StreamFormatter) error
func (*Server) ImageInspect ¶
func (*Server) ImagePull ¶
func (srv *Server) ImagePull(localName string, tag string, out io.Writer, sf *utils.StreamFormatter, authConfig *auth.AuthConfig, metaHeaders map[string][]string, parallel bool) error
func (*Server) ImagePush ¶
func (srv *Server) ImagePush(localName string, out io.Writer, sf *utils.StreamFormatter, authConfig *auth.AuthConfig, metaHeaders map[string][]string) error
FIXME: Allow to interrupt current push when new push of same image is done.
func (*Server) Images ¶
func (*Server) ImagesSearch ¶
func (srv *Server) ImagesSearch(term string) ([]registry.SearchResult, error)
func (*Server) ImagesViz ¶
func (*Server) ListenAndServe ¶
func (*Server) LogEvent ¶
func (srv *Server) LogEvent(action, id, from string) *utils.JSONMessage
func (*Server) RegisterLinks ¶
func (srv *Server) RegisterLinks(name string, hostConfig *HostConfig) error
type State ¶
type State struct { sync.Mutex Running bool Pid int ExitCode int StartedAt time.Time FinishedAt time.Time Ghost bool }
func (*State) String ¶
String returns a human-readable description of the state
type TagStore ¶
type TagStore struct { Repositories map[string]Repository // contains filtered or unexported fields }
func NewTagStore ¶
func (*TagStore) ByID ¶
Return a reverse-lookup table of all the names which refer to each image Eg. {"43b5f19b10584": {"base:latest", "base:v1"}}
func (*TagStore) Delete ¶
func (*TagStore) DeleteAll ¶
func (*TagStore) Get ¶
func (store *TagStore) Get(repoName string) (Repository, error)
func (*TagStore) GetImage ¶
func (*TagStore) ImageName ¶
func (*TagStore) LookupImage ¶
func (*TagStore) Reload ¶
func (*TagStore) Save ¶
func (*TagStore) Set ¶
Source Files ¶
api.go api_params.go api_unit_tests.go buildfile.go commands.go config.go container.go graph.go image.go links.go lxc_template.go network.go runtime.go server.go sorter.go state.go tags.go utils.go
Directories ¶
- Version
- v0.7.0-rc6
- Published
- Nov 20, 2013
- Platform
- darwin/amd64
- Imports
- 58 packages
- Last checked
- 12 seconds ago –
Tools for package owners.