2015-08-06 22:21:00 -04:00
|
|
|
package execdriver
|
|
|
|
|
2015-12-18 13:36:17 -05:00
|
|
|
import "github.com/docker/go-connections/nat"
|
2015-08-06 22:21:00 -04:00
|
|
|
|
2015-09-09 22:23:06 -04:00
|
|
|
// Mount contains information for a mount operation.
|
|
|
|
type Mount struct {
|
|
|
|
Source string `json:"source"`
|
|
|
|
Destination string `json:"destination"`
|
|
|
|
Writable bool `json:"writable"`
|
|
|
|
}
|
|
|
|
|
2015-10-05 13:11:10 -04:00
|
|
|
// Resources contains all resource configs for a driver.
|
|
|
|
// Currently these are all for cgroup configs.
|
|
|
|
type Resources struct {
|
|
|
|
CommonResources
|
|
|
|
|
|
|
|
// Fields below here are platform specific
|
|
|
|
}
|
|
|
|
|
2015-11-01 10:53:15 -05:00
|
|
|
// ProcessConfig is the platform specific structure that describes a process
|
|
|
|
// that will be run inside a container.
|
|
|
|
type ProcessConfig struct {
|
|
|
|
CommonProcessConfig
|
|
|
|
|
|
|
|
// Fields below here are platform specific
|
|
|
|
ConsoleSize [2]int `json:"-"` // h,w of initial console size
|
|
|
|
}
|
|
|
|
|
2015-08-06 22:21:00 -04:00
|
|
|
// Network settings of the container
|
|
|
|
type Network struct {
|
|
|
|
Interface *NetworkInterface `json:"interface"`
|
|
|
|
ContainerID string `json:"container_id"` // id of the container to join network.
|
|
|
|
}
|
|
|
|
|
|
|
|
// NetworkInterface contains network configs for a driver
|
|
|
|
type NetworkInterface struct {
|
|
|
|
MacAddress string `json:"mac"`
|
|
|
|
Bridge string `json:"bridge"`
|
|
|
|
IPAddress string `json:"ip"`
|
|
|
|
|
|
|
|
// PortBindings is the port mapping between the exposed port in the
|
|
|
|
// container and the port on the host.
|
|
|
|
PortBindings nat.PortMap `json:"port_bindings"`
|
|
|
|
}
|
2015-10-05 17:27:39 -04:00
|
|
|
|
|
|
|
// Command wraps an os/exec.Cmd to add more metadata
|
|
|
|
type Command struct {
|
|
|
|
CommonCommand
|
|
|
|
|
|
|
|
// Fields below here are platform specific
|
|
|
|
|
2015-12-18 13:36:17 -05:00
|
|
|
FirstStart bool `json:"first_start"` // Optimisation for first boot of Windows
|
|
|
|
Hostname string `json:"hostname"` // Windows sets the hostname in the execdriver
|
|
|
|
LayerFolder string `json:"layer_folder"` // Layer folder for a command
|
|
|
|
LayerPaths []string `json:"layer_paths"` // Layer paths for a command
|
|
|
|
Isolation string `json:"isolation"` // Isolation level for the container
|
|
|
|
ArgsEscaped bool `json:"args_escaped"` // True if args are already escaped
|
|
|
|
HvPartition bool `json:"hv_partition"` // True if it's an hypervisor partition
|
2015-10-05 17:27:39 -04:00
|
|
|
}
|
2015-10-31 22:31:24 -04:00
|
|
|
|
|
|
|
// ExitStatus provides exit reasons for a container.
|
|
|
|
type ExitStatus struct {
|
|
|
|
// The exit code with which the container exited.
|
|
|
|
ExitCode int
|
|
|
|
}
|