2014-02-19 00:56:11 +00:00
|
|
|
package libcontainer
|
|
|
|
|
2014-02-20 23:48:48 +00:00
|
|
|
import (
|
|
|
|
"github.com/dotcloud/docker/pkg/cgroups"
|
|
|
|
)
|
|
|
|
|
2014-02-20 06:43:40 +00:00
|
|
|
// Container defines configuration options for how a
|
|
|
|
// container is setup inside a directory and how a process should be executed
|
2014-02-19 00:56:11 +00:00
|
|
|
type Container struct {
|
2014-02-20 23:48:48 +00:00
|
|
|
Hostname string `json:"hostname,omitempty"` // hostname
|
|
|
|
ReadonlyFs bool `json:"readonly_fs,omitempty"` // set the containers rootfs as readonly
|
|
|
|
User string `json:"user,omitempty"` // user to execute the process as
|
|
|
|
WorkingDir string `json:"working_dir,omitempty"` // current working directory
|
|
|
|
Env []string `json:"environment,omitempty"` // environment to set
|
|
|
|
Namespaces Namespaces `json:"namespaces,omitempty"` // namespaces to apply
|
|
|
|
Capabilities Capabilities `json:"capabilities,omitempty"` // capabilities to drop
|
|
|
|
Network *Network `json:"network,omitempty"` // nil for host's network stack
|
|
|
|
Cgroups *cgroups.Cgroup `json:"cgroups,omitempty"`
|
2014-02-19 00:56:11 +00:00
|
|
|
}
|
|
|
|
|
2014-02-20 06:43:40 +00:00
|
|
|
// Network defines configuration for a container's networking stack
|
|
|
|
//
|
|
|
|
// The network configuration can be omited from a container causing the
|
|
|
|
// container to be setup with the host's networking stack
|
2014-02-19 00:56:11 +00:00
|
|
|
type Network struct {
|
2014-02-19 23:33:44 +00:00
|
|
|
IP string `json:"ip,omitempty"`
|
|
|
|
Gateway string `json:"gateway,omitempty"`
|
|
|
|
Bridge string `json:"bridge,omitempty"`
|
|
|
|
Mtu int `json:"mtu,omitempty"`
|
2014-02-19 00:56:11 +00:00
|
|
|
}
|