Documentation ¶
Index ¶
- Variables
- func Compare(a, b *container.Config) bool
- func DecodeContainerConfig(src io.Reader) (*container.Config, *container.HostConfig, *networktypes.NetworkingConfig, ...)
- func DecodeHostConfig(src io.Reader) (*container.HostConfig, error)
- func DefaultDaemonNetworkMode() container.NetworkMode
- func IsPreDefinedNetwork(network string) bool
- func SetDefaultNetModeIfBlank(hc *container.HostConfig) *container.HostConfig
- func ValidateIsolation(hc *container.HostConfig) error
- func ValidateNetMode(c *container.Config, hc *container.HostConfig) error
- func ValidateQoS(hc *container.HostConfig) error
- type ContainerConfigWrapper
- type ContainerDecoder
- type StreamConfig
- func (streamConfig *StreamConfig) CloseStreams() error
- func (streamConfig *StreamConfig) NewInputPipes()
- func (streamConfig *StreamConfig) NewNopInputPipe()
- func (streamConfig *StreamConfig) Stderr() *broadcaster.Unbuffered
- func (streamConfig *StreamConfig) StderrPipe() io.ReadCloser
- func (streamConfig *StreamConfig) Stdin() io.ReadCloser
- func (streamConfig *StreamConfig) StdinPipe() io.WriteCloser
- func (streamConfig *StreamConfig) Stdout() *broadcaster.Unbuffered
- func (streamConfig *StreamConfig) StdoutPipe() io.ReadCloser
Constants ¶
This section is empty.
Variables ¶
var ( // ErrConflictContainerNetworkAndLinks conflict between --net=container and links ErrConflictContainerNetworkAndLinks = fmt.Errorf("Conflicting options: container type network can't be used with links. This would result in undefined behavior") // ErrConflictUserDefinedNetworkAndLinks conflict between --net=<NETWORK> and links ErrConflictUserDefinedNetworkAndLinks = fmt.Errorf("Conflicting options: networking can't be used with links. This would result in undefined behavior") ErrConflictSharedNetwork = fmt.Errorf("Container sharing network namespace with another container or host cannot be connected to any other network") // ErrConflictHostNetwork conflict from being disconnected from host network or connected to host network. ErrConflictHostNetwork = fmt.Errorf("Container cannot be disconnected from host network or connected to host network") // ErrConflictNoNetwork conflict between private and other networks ErrConflictNoNetwork = fmt.Errorf("Container cannot be connected to multiple networks with one of the networks in private (none) mode") // ErrConflictNetworkAndDNS conflict between --dns and the network mode ErrConflictNetworkAndDNS = fmt.Errorf("Conflicting options: dns and the network mode") // ErrConflictNetworkHostname conflict between the hostname and the network mode ErrConflictNetworkHostname = fmt.Errorf("Conflicting options: hostname and the network mode") // ErrConflictHostNetworkAndLinks conflict between --net=host and links ErrConflictHostNetworkAndLinks = fmt.Errorf("Conflicting options: host type networking can't be used with links. This would result in undefined behavior") // ErrConflictContainerNetworkAndMac conflict between the mac address and the network mode ErrConflictContainerNetworkAndMac = fmt.Errorf("Conflicting options: mac-address and the network mode") // ErrConflictNetworkHosts conflict between add-host and the network mode ErrConflictNetworkHosts = fmt.Errorf("Conflicting options: custom host-to-IP mapping and the network mode") // ErrConflictNetworkPublishPorts conflict between the publish options and the network mode ErrConflictNetworkPublishPorts = fmt.Errorf("Conflicting options: port publishing and the container type network mode") // ErrConflictNetworkExposePorts conflict between the expose option and the network mode ErrConflictNetworkExposePorts = fmt.Errorf("Conflicting options: port exposing and the container type network mode") // ErrUnsupportedNetworkAndIP conflict between network mode and requested ip address ErrUnsupportedNetworkAndIP = fmt.Errorf("User specified IP address is supported on user defined networks only") // ErrUnsupportedNetworkNoSubnetAndIP conflict between network with no configured subnet and requested ip address ErrUnsupportedNetworkNoSubnetAndIP = fmt.Errorf("User specified IP address is supported only when connecting to networks with user configured subnets") // ErrUnsupportedNetworkAndAlias conflict between network mode and alias ErrUnsupportedNetworkAndAlias = fmt.Errorf("Network-scoped alias is supported only for containers in user defined networks") // ErrConflictUTSHostname conflict between the hostname and the UTS mode ErrConflictUTSHostname = fmt.Errorf("Conflicting options: hostname and the UTS mode") )
Functions ¶
func Compare ¶
Compare two Config struct. Do not compare the "Image" nor "Hostname" fields If OpenStdin is set, then it differs
func DecodeContainerConfig ¶ added in v1.7.0
func DecodeContainerConfig(src io.Reader) (*container.Config, *container.HostConfig, *networktypes.NetworkingConfig, error)
DecodeContainerConfig decodes a json encoded config into a ContainerConfigWrapper struct and returns both a Config and a HostConfig struct Be aware this function is not checking whether the resulted structs are nil, it's your business to do so
func DecodeHostConfig ¶ added in v1.7.0
func DecodeHostConfig(src io.Reader) (*container.HostConfig, error)
DecodeHostConfig creates a HostConfig based on the specified Reader. It assumes the content of the reader will be JSON, and decodes it.
func DefaultDaemonNetworkMode ¶ added in v1.8.0
func DefaultDaemonNetworkMode() container.NetworkMode
DefaultDaemonNetworkMode returns the default network stack the daemon should use.
func IsPreDefinedNetwork ¶ added in v1.9.0
IsPreDefinedNetwork indicates if a network is predefined by the daemon
func SetDefaultNetModeIfBlank ¶ added in v1.9.0
func SetDefaultNetModeIfBlank(hc *container.HostConfig) *container.HostConfig
SetDefaultNetModeIfBlank changes the NetworkMode in a HostConfig structure to default if it is not populated. This ensures backwards compatibility after the validation of the network mode was moved from the docker CLI to the docker daemon.
func ValidateIsolation ¶ added in v1.11.0
func ValidateIsolation(hc *container.HostConfig) error
ValidateIsolation performs platform specific validation of isolation in the hostconfig structure. Linux only supports "default" which is LXC container isolation
func ValidateNetMode ¶ added in v1.9.0
func ValidateNetMode(c *container.Config, hc *container.HostConfig) error
ValidateNetMode ensures that the various combinations of requested network settings are valid.
func ValidateQoS ¶ added in v1.12.0
func ValidateQoS(hc *container.HostConfig) error
ValidateQoS performs platform specific validation of the QoS settings
Types ¶
type ContainerConfigWrapper ¶ added in v1.7.0
type ContainerConfigWrapper struct { *container.Config InnerHostConfig *container.HostConfig `json:"HostConfig,omitempty"` Cpuset string `json:",omitempty"` // Deprecated. Exported for backwards compatibility. NetworkingConfig *networktypes.NetworkingConfig `json:"NetworkingConfig,omitempty"` *container.HostConfig // Deprecated. Exported to read attributes from json that are not in the inner host config structure. }
ContainerConfigWrapper is a Config wrapper that holds the container Config (portable) and the corresponding HostConfig (non-portable).
type ContainerDecoder ¶ added in v1.12.0
type ContainerDecoder struct{}
ContainerDecoder implements httputils.ContainerDecoder calling DecodeContainerConfig.
func (ContainerDecoder) DecodeConfig ¶ added in v1.12.0
func (r ContainerDecoder) DecodeConfig(src io.Reader) (*container.Config, *container.HostConfig, *networktypes.NetworkingConfig, error)
DecodeConfig makes ContainerDecoder to implement httputils.ContainerDecoder
func (ContainerDecoder) DecodeHostConfig ¶ added in v1.12.0
func (r ContainerDecoder) DecodeHostConfig(src io.Reader) (*container.HostConfig, error)
DecodeHostConfig makes ContainerDecoder to implement httputils.ContainerDecoder
type StreamConfig ¶ added in v1.10.0
StreamConfig holds information about I/O streams managed together.
streamConfig.StdinPipe returns a WriteCloser which can be used to feed data to the standard input of the streamConfig's active process. streamConfig.StdoutPipe and streamConfig.StderrPipe each return a ReadCloser which can be used to retrieve the standard output (and error) generated by the container's active process. The output (and error) are actually copied and delivered to all StdoutPipe and StderrPipe consumers, using a kind of "broadcaster".
func NewStreamConfig ¶ added in v1.10.0
func NewStreamConfig() *StreamConfig
NewStreamConfig creates a stream config and initializes the standard err and standard out to new unbuffered broadcasters.
func (*StreamConfig) CloseStreams ¶ added in v1.10.0
func (streamConfig *StreamConfig) CloseStreams() error
CloseStreams ensures that the configured streams are properly closed.
func (*StreamConfig) NewInputPipes ¶ added in v1.10.0
func (streamConfig *StreamConfig) NewInputPipes()
NewInputPipes creates new pipes for both standard inputs, Stdin and StdinPipe.
func (*StreamConfig) NewNopInputPipe ¶ added in v1.10.0
func (streamConfig *StreamConfig) NewNopInputPipe()
NewNopInputPipe creates a new input pipe that will silently drop all messages in the input.
func (*StreamConfig) Stderr ¶ added in v1.10.0
func (streamConfig *StreamConfig) Stderr() *broadcaster.Unbuffered
Stderr returns the standard error in the configuration.
func (*StreamConfig) StderrPipe ¶ added in v1.10.0
func (streamConfig *StreamConfig) StderrPipe() io.ReadCloser
StderrPipe creates a new io.ReadCloser with an empty bytes pipe. It adds this new err pipe to the Stderr broadcaster.
func (*StreamConfig) Stdin ¶ added in v1.10.0
func (streamConfig *StreamConfig) Stdin() io.ReadCloser
Stdin returns the standard input in the configuration.
func (*StreamConfig) StdinPipe ¶ added in v1.10.0
func (streamConfig *StreamConfig) StdinPipe() io.WriteCloser
StdinPipe returns an input writer pipe as an io.WriteCloser.
func (*StreamConfig) Stdout ¶ added in v1.10.0
func (streamConfig *StreamConfig) Stdout() *broadcaster.Unbuffered
Stdout returns the standard output in the configuration.
func (*StreamConfig) StdoutPipe ¶ added in v1.10.0
func (streamConfig *StreamConfig) StdoutPipe() io.ReadCloser
StdoutPipe creates a new io.ReadCloser with an empty bytes pipe. It adds this new out pipe to the Stdout broadcaster.