runconfig

package
v1.6.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidWorkingDirectory          = fmt.Errorf("The working directory is invalid. It needs to be an absolute path.")
	ErrConflictContainerNetworkAndLinks = fmt.Errorf("Conflicting options: --net=container can't be used with links. This would result in undefined behavior.")
	ErrConflictContainerNetworkAndDns   = fmt.Errorf("Conflicting options: --net=container can't be used with --dns. This configuration is invalid.")
	ErrConflictNetworkHostname          = fmt.Errorf("Conflicting options: -h and the network mode (--net)")
	ErrConflictHostNetworkAndDns        = fmt.Errorf("Conflicting options: --net=host can't be used with --dns. This configuration is invalid.")
	ErrConflictHostNetworkAndLinks      = fmt.Errorf("Conflicting options: --net=host can't be used with links. This would result in undefined behavior.")
)

Functions

func Compare

func Compare(a, b *Config) bool

Compare two Config struct. Do not compare the "Image" nor "Hostname" fields If OpenStdin is set, then it differs

func Merge

func Merge(userConf, imageConf *Config) error

func Parse

func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSet, 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
	ExposedPorts    map[nat.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
	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
	Labels          map[string]string
}

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.

func ContainerConfigFromJob

func ContainerConfigFromJob(job *engine.Job) *Config

type ConfigAndHostConfig added in v1.3.0

type ConfigAndHostConfig struct {
	Config
	HostConfig HostConfig
}

This is used by the create command when you want to set both the Config and the HostConfig in the same call

func MergeConfigs added in v1.3.0

func MergeConfigs(config *Config, hostConfig *HostConfig) *ConfigAndHostConfig

type DeviceMapping added in v1.2.0

type DeviceMapping struct {
	PathOnHost        string
	PathInContainer   string
	CgroupPermissions string
}

func ParseDevice added in v1.2.0

func ParseDevice(device string) (DeviceMapping, error)

type ExecConfig added in v1.3.0

type ExecConfig struct {
	User         string
	Privileged   bool
	Tty          bool
	Container    string
	AttachStdin  bool
	AttachStderr bool
	AttachStdout bool
	Detach       bool
	Cmd          []string
}

func ExecConfigFromJob added in v1.3.0

func ExecConfigFromJob(job *engine.Job) (*ExecConfig, error)

func ParseExec added in v1.3.0

func ParseExec(cmd *flag.FlagSet, args []string) (*ExecConfig, error)

type HostConfig

type HostConfig struct {
	Binds           []string
	ContainerIDFile string
	LxcConf         []utils.KeyValuePair
	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
	PortBindings    nat.PortMap
	Links           []string
	PublishAllPorts bool
	Dns             []string
	DnsSearch       []string
	ExtraHosts      []string
	VolumesFrom     []string
	Devices         []DeviceMapping
	NetworkMode     NetworkMode
	IpcMode         IpcMode
	PidMode         PidMode
	CapAdd          []string
	CapDrop         []string
	RestartPolicy   RestartPolicy
	SecurityOpt     []string
	ReadonlyRootfs  bool
	Ulimits         []*ulimit.Ulimit
	LogConfig       LogConfig
	CgroupParent    string // Parent cgroup.
}

func ContainerHostConfigFromJob

func ContainerHostConfigFromJob(job *engine.Job) *HostConfig

type IpcMode added in v1.4.0

type IpcMode string

func (IpcMode) Container added in v1.4.0

func (n IpcMode) Container() string

func (IpcMode) IsContainer added in v1.4.0

func (n IpcMode) IsContainer() bool

func (IpcMode) IsHost added in v1.4.0

func (n IpcMode) IsHost() bool

func (IpcMode) IsPrivate added in v1.4.0

func (n IpcMode) IsPrivate() bool

IsPrivate indicates whether container use it's private ipc stack

func (IpcMode) Valid added in v1.4.0

func (n IpcMode) Valid() bool

type LogConfig added in v1.6.0

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

type NetworkMode added in v0.11.0

type NetworkMode string

func (NetworkMode) IsContainer added in v0.11.0

func (n NetworkMode) IsContainer() bool

func (NetworkMode) IsHost added in v0.11.0

func (n NetworkMode) IsHost() bool

func (NetworkMode) IsNone added in v1.3.0

func (n NetworkMode) IsNone() bool

func (NetworkMode) IsPrivate added in v1.3.0

func (n NetworkMode) IsPrivate() bool

IsPrivate indicates whether container use it's private network stack

type PidMode added in v1.5.0

type PidMode string

func (PidMode) IsHost added in v1.5.0

func (n PidMode) IsHost() bool

func (PidMode) IsPrivate added in v1.5.0

func (n PidMode) IsPrivate() bool

IsPrivate indicates whether container use it's private pid stack

func (PidMode) Valid added in v1.5.0

func (n PidMode) Valid() bool

type RestartPolicy added in v1.2.0

type RestartPolicy struct {
	Name              string
	MaximumRetryCount int
}

Jump to

Keyboard shortcuts

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