2015-07-03 01:01:27 +08:00
package specs
// Spec is the base configuration for the container. It specifies platform
// independent configuration.
type Spec struct {
// Version is the version of the specification that is supported.
Version string ` json:"version" `
// Platform is the host information for OS and Arch.
Platform Platform ` json:"platform" `
// Process is the container's main process.
Process Process ` json:"process" `
// Root is the root information for the container's filesystem.
Root Root ` json:"root" `
2015-07-10 17:23:13 +08:00
// Hostname is the container's host name.
2015-07-03 01:01:27 +08:00
Hostname string ` json:"hostname" `
// Mounts profile configuration for adding mounts to the container's filesystem.
2015-09-02 23:42:54 +08:00
Mounts [ ] MountPoint ` json:"mounts" `
2015-07-03 01:01:27 +08:00
}
// Process contains information to start a specific application inside the container.
type Process struct {
// Terminal creates an interactive terminal for the container.
Terminal bool ` json:"terminal" `
// User specifies user information for the process.
User User ` json:"user" `
// Args specifies the binary and arguments for the application to execute.
Args [ ] string ` json:"args" `
// Env populates the process environment for the process.
Env [ ] string ` json:"env" `
// Cwd is the current working directory for the process and must be
// relative to the container's root.
Cwd string ` json:"cwd" `
}
// Root contains information about the container's root filesystem on the host.
type Root struct {
// Path is the absolute path to the container's root filesystem.
Path string ` json:"path" `
// Readonly makes the root filesystem for the container readonly before the process is executed.
Readonly bool ` json:"readonly" `
}
// Platform specifies OS and arch information for the host system that the container
// is created for.
type Platform struct {
// OS is the operating system.
OS string ` json:"os" `
// Arch is the architecture
Arch string ` json:"arch" `
}
2015-08-04 01:52:52 +08:00
2015-07-31 03:17:04 +08:00
// MountPoint describes a directory that may be fullfilled by a mount in the runtime.json.
type MountPoint struct {
// Name is a unique descriptive identifier for this mount point.
Name string ` json:"name" `
// Path specifies the path of the mount. The path and child directories MUST exist, a runtime MUST NOT create directories automatically to a mount point.
Path string ` json:"path" `
2015-08-04 01:52:52 +08:00
}
2015-07-30 05:09:30 +08:00
// State holds information about the runtime state of the container.
type State struct {
// Version is the version of the specification that is supported.
Version string ` json:"version" `
// ID is the container ID
ID string ` json:"id" `
// Pid is the process id for the container's main process.
Pid int ` json:"pid" `
// Root is the path to the container's bundle directory.
Root string ` json:"root" `
}