docker

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

README

Introduce

  • The files in this directory is used to contact with docker deamon;

  • While getting the data from the docker daemon, it will send it to Hyper daemon;

Documentation

Overview

Build this with the docker configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayJSONMessagesStream

func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, isTerminal bool) error

Types

type Config

type Config struct {
	Hostname        string
	Domainname      string
	User            string
	Memory          int64  // FIXME: we keep it for backward compatibility, it has been moved to hostConfig.
	MemorySwap      int64  // FIXME: it has been moved to hostConfig.
	CpuShares       int64  // FIXME: it has been moved to hostConfig.
	Cpuset          string // FIXME: it has been moved to hostConfig and renamed to CpusetCpus.
	AttachStdin     bool
	AttachStdout    bool
	AttachStderr    bool
	PortSpecs       []string // Deprecated - Can be in the format of 8080/tcp
	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
	Image           string // Name of the image as it was passed by the operator (eg. could be symbolic)
	Volumes         map[string]struct{}
	WorkingDir      string
	Entrypoint      []string
	NetworkDisabled bool
	MacAddress      string
	OnBuild         []string
	SecurityOpt     []string
	Labels          map[string]string
}

type ConfigAndHostConfig

type ConfigAndHostConfig struct {
	Config
	HostConfig HostConfig
}

type ConfigJSON

type ConfigJSON struct {
	AppArmorProfile string     `json:"AppArmorProfile"`
	Args            []string   `json:"Args"`
	Config          TypeConfig `json:"Config"`
	Created         string     `json:"Created"`
	Driver          string     `json:"Driver"`
	ExecDriver      string     `json:"ExecDriver"`
	ExecIds         string     `json:"ExecIDs"`
	HostConfig      struct{}   `json:"HostConfig"`
	HostnamePath    string     `json:"HostnamePath"`
	HostsPath       string     `json:"HostsPath"`
	Id              string     `json:"Id"`
	Image           string     `json:"Image"`
	MountLabel      string     `json:"MountLabel"`
	Name            string     `json:"Name"`
	NetworkSettings struct{}   `json:"NetworkSettings"`
	Path            string     `json:"Path"`
	ProcessLabel    string     `json:"ProcessLabel"`
	ResolvConfPath  string     `json:"ResolvConfPath"`
	RestartCount    int        `json:"RestartCount"`
	State           struct{}   `json:"State"`
	Volumes         struct{}   `json:"Volumes"`
	VolumesRW       struct{}   `json:"VolumesRW"`
}

type DeviceMapping

type DeviceMapping struct {
	PathOnHost        string
	PathInContainer   string
	CgroupPermissions string
}

type DockerCli

type DockerCli struct {
	// contains filtered or unexported fields
}

func NewDockerCli

func NewDockerCli(keyFile string, proto, addr string, tlsConfig *tls.Config) *DockerCli

func (*DockerCli) Call

func (cli *DockerCli) Call(method, path string, data interface{}, headers map[string][]string) (io.ReadCloser, int, error)

func (*DockerCli) ExecDockerCmd

func (cli *DockerCli) ExecDockerCmd(args ...string) ([]byte, int, error)

func (*DockerCli) GetContainerInfo

func (cli *DockerCli) GetContainerInfo(args ...string) (*ConfigJSON, error)

func (*DockerCli) HTTPClient

func (cli *DockerCli) HTTPClient() *http.Client

func (*DockerCli) SendCmdCreate

func (cli *DockerCli) SendCmdCreate(args ...string) ([]byte, int, error)

func (*DockerCli) SendCmdDelete

func (cli *DockerCli) SendCmdDelete(args ...string) ([]byte, int, error)

func (*DockerCli) SendCmdInfo

func (cli *DockerCli) SendCmdInfo(args ...string) ([]byte, int, error)

func (*DockerCli) SendCmdPull

func (cli *DockerCli) SendCmdPull(args ...string) ([]byte, int, error)

func (*DockerCli) Stream

func (cli *DockerCli) Stream(method, path string, in io.Reader, stdout io.Writer, headers map[string][]string) error

type DockerConfig

type DockerConfig struct {
	// contains filtered or unexported fields
}

Define some common configuration of the Docker daemon

type HostConfig

type HostConfig struct {
	Binds           []string
	ContainerIDFile string
	Memory          int64  // Memory limit (in bytes)
	MemorySwap      int64  // Total memory usage (memory + swap); set `-1` to disable swap
	CpuShares       int64  // CPU shares (relative weight vs. other containers)
	CpusetCpus      string // CpusetCpus 0-2, 0,1
	Privileged      bool
	Links           []string
	PublishAllPorts bool
	Dns             []string
	DnsSearch       []string
	ExtraHosts      []string
	VolumesFrom     []string
	Devices         []DeviceMapping
	NetworkMode     string
	IpcMode         string
	PidMode         string
	CapAdd          []string
	CapDrop         []string
	RestartPolicy   RestartPolicy
	SecurityOpt     []string
	ReadonlyRootfs  bool
	LogConfig       LogConfig
	CgroupParent    string // Parent cgroup.
}

type JSONError

type JSONError struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

func (*JSONError) Error

func (e *JSONError) Error() string

type JSONMessage

type JSONMessage struct {
	Stream          string        `json:"stream,omitempty"`
	Status          string        `json:"status,omitempty"`
	Progress        *JSONProgress `json:"progressDetail,omitempty"`
	ProgressMessage string        `json:"progress,omitempty"` //deprecated
	ID              string        `json:"id,omitempty"`
	From            string        `json:"from,omitempty"`
	Time            int64         `json:"time,omitempty"`
	Error           *JSONError    `json:"errorDetail,omitempty"`
	ErrorMessage    string        `json:"error,omitempty"` //deprecated
}

func (*JSONMessage) Display

func (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error

type JSONProgress

type JSONProgress struct {
	Current int   `json:"current,omitempty"`
	Total   int   `json:"total,omitempty"`
	Start   int64 `json:"start,omitempty"`
	// contains filtered or unexported fields
}

func (*JSONProgress) String

func (p *JSONProgress) String() string

type LogConfig

type LogConfig struct {
	Type   string
	Config map[string]string
}

type RestartPolicy

type RestartPolicy struct {
	Name              string
	MaximumRetryCount int
}

type TypeConfig

type TypeConfig struct {
	AttachStderr    bool                `json:"AttachStderr"`
	AttachStdin     bool                `json:"AttachStdin"`
	AttachStdout    bool                `json:"AttachStdout"`
	Cmd             []string            `json:"Cmd"`
	CpuShares       int64               `json:"CpuShares"`
	Cpuset          string              `json:"Cpuset"`
	Domainname      string              `json:"Domainname"`
	Entrypoint      []string            `json:"Entrypoint"`
	Env             []string            `json:"Env"`
	ExposedPorts    map[string]struct{} `json:"ExposedPorts"`
	Hostname        string              `json:"Hostname"`
	Image           string              `json:"Image"`
	MacAddress      string              `json:"MacAddress"`
	Memory          int64               `json:"Memory"`
	MemorySwap      int64               `json:"MemorySwap"`
	NetworkDisabled bool                `json:"NetworkDisabled"`
	OnBuild         []string            `json:"OnBuild"`
	OpenStdin       bool                `json:"OpenStdin"`
	PortSpecs       []string            `json:"PortSpecs"`
	StdinOnce       bool                `json:"StdinOnce"`
	Tty             bool                `json:"Tty"`
	User            string              `json:"User"`
	Volumes         map[string]struct{} `json:"Volumes"`
	WorkingDir      string              `json:"WorkingDir"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL