Documentation ¶
Index ¶
- Variables
- func Compare(a, b *Config) bool
- func Merge(userConf, imageConf *Config) error
- func Parse(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Config, *HostConfig, *flag.FlagSet, error)
- type Config
- type ConfigAndHostConfig
- type DeviceMapping
- type ExecConfig
- type HostConfig
- type NetworkMode
- type RestartPolicy
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 ¶
Types ¶
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 Cpuset string // Cpuset 0-2, 0,1 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 OnBuild []string MonitorDriver 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 ¶
type ConfigAndHostConfig ¶
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 ¶
func MergeConfigs(config *Config, hostConfig *HostConfig) *ConfigAndHostConfig
type DeviceMapping ¶
func ParseDevice ¶
func ParseDevice(device string) (DeviceMapping, error)
type ExecConfig ¶
type ExecConfig struct { User string Privileged bool Tty bool Container string AttachStdin bool AttachStderr bool AttachStdout bool Detach bool Cmd []string }
func ExecConfigFromJob ¶
func ExecConfigFromJob(job *engine.Job) *ExecConfig
type HostConfig ¶
type HostConfig struct { Binds []string ContainerIDFile string LxcConf []utils.KeyValuePair Privileged bool PortBindings nat.PortMap Links []string PublishAllPorts bool Dns []string DnsSearch []string ExtraHosts []string VolumesFrom []string Devices []DeviceMapping NetworkMode NetworkMode CapAdd []string CapDrop []string RestartPolicy RestartPolicy SecurityOpt []string }
func ContainerHostConfigFromJob ¶
func ContainerHostConfigFromJob(job *engine.Job) *HostConfig
type NetworkMode ¶
type NetworkMode string
func (NetworkMode) IsContainer ¶
func (n NetworkMode) IsContainer() bool
func (NetworkMode) IsHost ¶
func (n NetworkMode) IsHost() bool
func (NetworkMode) IsNone ¶
func (n NetworkMode) IsNone() bool
func (NetworkMode) IsPrivate ¶
func (n NetworkMode) IsPrivate() bool
IsPrivate indicates whether container use it's private network stack
type RestartPolicy ¶
Click to show internal directories.
Click to hide internal directories.