Documentation ¶
Overview ¶
The crocker package provides an abstract container system.
Crocker is based on wrapping docker, and internally, operates by exec'ing docker commands and the CLI interface. The Crocker API conceals the fact that it uses the exec cli, and may in the future be transparently reimplemented to use other docker APIs.
Index ¶
- Constants
- func CreateCIDfile() string
- func PollCid(filename string) chan string
- func SplitImageName(image string) (string, string)
- type APIAuth
- type APIContainers
- type APIContainersOld
- type APICopy
- type APIHistory
- type APIID
- type APIImages
- type APIInfo
- type APIPort
- type APIRmi
- type APIRun
- type APISearch
- type APITop
- type APIVersion
- type APIWait
- type Container
- type Dock
- func (dock *Dock) Call(method, path string, data interface{}) ([]byte, int)
- func (dock *Dock) CheckCache(image string) bool
- func (dock *Dock) Close()
- func (dock *Dock) Cmd() Command
- func (dock *Dock) Import(reader io.Reader, name string, tag string)
- func (dock *Dock) ImportFromFilename(path string, name string, tag string)
- func (dock *Dock) ImportFromFilenameTagstring(path, image string)
- func (dock *Dock) PrintVersion()
- func (dock *Dock) Pull(image string)
Constants ¶
const ApiVersion = "1.10" //Docker api version
const DefaultTag = "latest"
The default docker tag
const ServerVersion = "0.10.0" //Docker header version so its log can complain :)
const TempDir = "/tmp"
Where to place & call CIDfiles
const TempPrefix = "trion-"
Variables ¶
This section is empty.
Functions ¶
func CreateCIDfile ¶
func CreateCIDfile() string
Create a temporary file for docker to print its CID to
func PollCid ¶
Given a filename that docker prints a ContainerID to, poll for file and write that CID to a channel.
This defeats the rather insane problem caused by docker not really writing the CIDfile at any particular time...
func SplitImageName ¶
Given an image string, returns the image name and tag.
'ubuntu:12.10' -> 'ubuntu', '12.10' 'ubuntu' -> 'ubuntu', 'latest'
Types ¶
type APIContainers ¶
type APIContainersOld ¶
type APIHistory ¶
type APIInfo ¶
type APIInfo struct { Debug bool Containers int Images int 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 ¶
func (*APIPort) MarshalJSON ¶
type APIVersion ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Refers to a Container process. The container has been started and has an ID. Methods on this struct can be used to inspect and manipulate the container.
func Launch ¶
func Launch(dock *Dock, image string, command []string, attach bool, privileged bool, startIn string, dns []string, mounts [][]string, ports [][]string, environment [][]string) *Container
Launches a new Container in the given Dock. Punting on documentation while things are in flux; see command.go struct for details.
func (*Container) ExportToFilename ¶
Convenience wrapper for Export(io.Writer) but writing to a file.
func (*Container) Purge ¶
func (c *Container) Purge()
Discards the container state and filesystem (i.e., wraps `docker rm`).
After this method completes, many other inspection methods on this Container become invalid and will error, because the backing data has been, well, purged.
This will error if called on a still-running container.
type Dock ¶
type Dock struct {
// contains filtered or unexported fields
}
A struct representing a connection to a docker daemon
func (*Dock) Call ¶ added in v0.5.2
Hit the docker daemon with an HTTP request, returns response byte array
func (*Dock) CheckCache ¶
Check if an image is loaded in docker's cache.
func (*Dock) Cmd ¶ added in v0.5.2
func (dock *Dock) Cmd() Command
Returns a gosh command struct for use in exec-wrapping docker
func (*Dock) Import ¶
Import an image into repository, caching the expanded form so that it's ready to be used as a base filesystem for containers.
func (*Dock) ImportFromFilename ¶
func (*Dock) ImportFromFilenameTagstring ¶
Import an image from a docker-style image string, such as 'ubuntu:latest'
func (*Dock) PrintVersion ¶ added in v0.5.3
func (dock *Dock) PrintVersion()
Run the simple docker version command for debugging