Documentation ¶
Index ¶
- Variables
- func TagToName(tag string) string
- func UUID() (string, error)
- type Builder
- type Container
- func (c *Container) BindMount(volume string) error
- func (c *Container) Create(parent string) error
- func (c *Container) Destroy() error
- func (c *Container) RunCommand(command []string) error
- func (c *Container) Start() error
- func (c *Container) Stop() error
- func (c *Container) UpdateUTS(name string) error
- type Group
- type Image
- type Manifest
- type Member
Constants ¶
This section is empty.
Variables ¶
var ( // MinimalEnv used to set exec environment for command invocation inside lxc MinimalEnv = []string{ "SHELL=/bin/bash", "USER=root", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PWD=/root", "EDITOR=vim", "LANG=en_US.UTF-8", "HOME=/root", "LANGUAGE=en_US", "LOGNAME=root", } )
Functions ¶
Types ¶
type Builder ¶
Builder represents a container build environment
type Container ¶
type Container struct { Manifest Manifest // contains filtered or unexported fields }
Container represents a container with some metadata
func NewContainer ¶
NewContainer returns a container struct
func (*Container) BindMount ¶
BindMount sets up bind mount for the container, where the input string specifies the host directory, container directory and mount options separated by ":"
func (*Container) RunCommand ¶
RunCommand runs a command inside the container with enviroment, workdir, user as specified by its manifest
type Group ¶
Group represents a set of containers
func GroupFromYAML ¶
GroupFromYAML initializes a Group struct from yaml file
type Image ¶
type Image struct { Path string // contains filtered or unexported fields }
Image represent a container image, which holds rootfs and metadata
func (*Image) Create ¶
Create creates a new tarball image from a container. sudo is used for invoking tar, if set to true
func (*Image) Decompress ¶
Decompress decompress the image into a container
type Manifest ¶
type Manifest struct { Labels map[string]string Maintainers []string ExposedPorts []uint64 EntryPoint []string Env []string User string WorkDir string }
Manifest represents metadata about a container
type Member ¶
type Member struct { Build string ContainerName string `yaml:"container_name"` Hostname string `yaml:"hostname"` Command string Volumes []string User string Environment []string Ports []string // contains filtered or unexported fields }
Member represents an individual member in a container group
func (*Member) RunCommand ¶
RunCommand runs the member's specified command inside it representative container