|
@@ -89,6 +89,8 @@ type User struct {
|
|
UID uint32 `json:"uid" platform:"linux,solaris"`
|
|
UID uint32 `json:"uid" platform:"linux,solaris"`
|
|
// GID is the group id.
|
|
// GID is the group id.
|
|
GID uint32 `json:"gid" platform:"linux,solaris"`
|
|
GID uint32 `json:"gid" platform:"linux,solaris"`
|
|
|
|
+ // Umask is the umask for the init process.
|
|
|
|
+ Umask *uint32 `json:"umask,omitempty" platform:"linux,solaris"`
|
|
// AdditionalGids are additional group ids set for the container's process.
|
|
// AdditionalGids are additional group ids set for the container's process.
|
|
AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"`
|
|
AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"`
|
|
// Username is the user name.
|
|
// Username is the user name.
|
|
@@ -123,13 +125,26 @@ type Hook struct {
|
|
Timeout *int `json:"timeout,omitempty"`
|
|
Timeout *int `json:"timeout,omitempty"`
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// Hooks specifies a command that is run in the container at a particular event in the lifecycle of a container
|
|
// Hooks for container setup and teardown
|
|
// Hooks for container setup and teardown
|
|
type Hooks struct {
|
|
type Hooks struct {
|
|
- // Prestart is a list of hooks to be run before the container process is executed.
|
|
|
|
|
|
+ // Prestart is Deprecated. Prestart is a list of hooks to be run before the container process is executed.
|
|
|
|
+ // It is called in the Runtime Namespace
|
|
Prestart []Hook `json:"prestart,omitempty"`
|
|
Prestart []Hook `json:"prestart,omitempty"`
|
|
|
|
+ // CreateRuntime is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called
|
|
|
|
+ // It is called in the Runtime Namespace
|
|
|
|
+ CreateRuntime []Hook `json:"createRuntime,omitempty"`
|
|
|
|
+ // CreateContainer is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called
|
|
|
|
+ // It is called in the Container Namespace
|
|
|
|
+ CreateContainer []Hook `json:"createContainer,omitempty"`
|
|
|
|
+ // StartContainer is a list of hooks to be run after the start operation is called but before the container process is started
|
|
|
|
+ // It is called in the Container Namespace
|
|
|
|
+ StartContainer []Hook `json:"startContainer,omitempty"`
|
|
// Poststart is a list of hooks to be run after the container process is started.
|
|
// Poststart is a list of hooks to be run after the container process is started.
|
|
|
|
+ // It is called in the Runtime Namespace
|
|
Poststart []Hook `json:"poststart,omitempty"`
|
|
Poststart []Hook `json:"poststart,omitempty"`
|
|
// Poststop is a list of hooks to be run after the container process exits.
|
|
// Poststop is a list of hooks to be run after the container process exits.
|
|
|
|
+ // It is called in the Runtime Namespace
|
|
Poststop []Hook `json:"poststop,omitempty"`
|
|
Poststop []Hook `json:"poststop,omitempty"`
|
|
}
|
|
}
|
|
|
|
|
|
@@ -165,6 +180,8 @@ type Linux struct {
|
|
// IntelRdt contains Intel Resource Director Technology (RDT) information for
|
|
// IntelRdt contains Intel Resource Director Technology (RDT) information for
|
|
// handling resource constraints (e.g., L3 cache, memory bandwidth) for the container
|
|
// handling resource constraints (e.g., L3 cache, memory bandwidth) for the container
|
|
IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"`
|
|
IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"`
|
|
|
|
+ // Personality contains configuration for the Linux personality syscall
|
|
|
|
+ Personality *LinuxPersonality `json:"personality,omitempty"`
|
|
}
|
|
}
|
|
|
|
|
|
// LinuxNamespace is the configuration for a Linux namespace
|
|
// LinuxNamespace is the configuration for a Linux namespace
|
|
@@ -183,17 +200,17 @@ const (
|
|
// PIDNamespace for isolating process IDs
|
|
// PIDNamespace for isolating process IDs
|
|
PIDNamespace LinuxNamespaceType = "pid"
|
|
PIDNamespace LinuxNamespaceType = "pid"
|
|
// NetworkNamespace for isolating network devices, stacks, ports, etc
|
|
// NetworkNamespace for isolating network devices, stacks, ports, etc
|
|
- NetworkNamespace = "network"
|
|
|
|
|
|
+ NetworkNamespace LinuxNamespaceType = "network"
|
|
// MountNamespace for isolating mount points
|
|
// MountNamespace for isolating mount points
|
|
- MountNamespace = "mount"
|
|
|
|
|
|
+ MountNamespace LinuxNamespaceType = "mount"
|
|
// IPCNamespace for isolating System V IPC, POSIX message queues
|
|
// IPCNamespace for isolating System V IPC, POSIX message queues
|
|
- IPCNamespace = "ipc"
|
|
|
|
|
|
+ IPCNamespace LinuxNamespaceType = "ipc"
|
|
// UTSNamespace for isolating hostname and NIS domain name
|
|
// UTSNamespace for isolating hostname and NIS domain name
|
|
- UTSNamespace = "uts"
|
|
|
|
|
|
+ UTSNamespace LinuxNamespaceType = "uts"
|
|
// UserNamespace for isolating user and group IDs
|
|
// UserNamespace for isolating user and group IDs
|
|
- UserNamespace = "user"
|
|
|
|
|
|
+ UserNamespace LinuxNamespaceType = "user"
|
|
// CgroupNamespace for isolating cgroup hierarchies
|
|
// CgroupNamespace for isolating cgroup hierarchies
|
|
- CgroupNamespace = "cgroup"
|
|
|
|
|
|
+ CgroupNamespace LinuxNamespaceType = "cgroup"
|
|
)
|
|
)
|
|
|
|
|
|
// LinuxIDMapping specifies UID/GID mappings
|
|
// LinuxIDMapping specifies UID/GID mappings
|
|
@@ -219,6 +236,7 @@ type POSIXRlimit struct {
|
|
// LinuxHugepageLimit structure corresponds to limiting kernel hugepages
|
|
// LinuxHugepageLimit structure corresponds to limiting kernel hugepages
|
|
type LinuxHugepageLimit struct {
|
|
type LinuxHugepageLimit struct {
|
|
// Pagesize is the hugepage size
|
|
// Pagesize is the hugepage size
|
|
|
|
+ // Format: "<size><unit-prefix>B' (e.g. 64KB, 2MB, 1GB, etc.)
|
|
Pagesize string `json:"pageSize"`
|
|
Pagesize string `json:"pageSize"`
|
|
// Limit is the limit of "hugepagesize" hugetlb usage
|
|
// Limit is the limit of "hugepagesize" hugetlb usage
|
|
Limit uint64 `json:"limit"`
|
|
Limit uint64 `json:"limit"`
|
|
@@ -290,6 +308,8 @@ type LinuxMemory struct {
|
|
Swappiness *uint64 `json:"swappiness,omitempty"`
|
|
Swappiness *uint64 `json:"swappiness,omitempty"`
|
|
// DisableOOMKiller disables the OOM killer for out of memory conditions
|
|
// DisableOOMKiller disables the OOM killer for out of memory conditions
|
|
DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"`
|
|
DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"`
|
|
|
|
+ // Enables hierarchical memory accounting
|
|
|
|
+ UseHierarchy *bool `json:"useHierarchy,omitempty"`
|
|
}
|
|
}
|
|
|
|
|
|
// LinuxCPU for Linux cgroup 'cpu' resource management
|
|
// LinuxCPU for Linux cgroup 'cpu' resource management
|
|
@@ -386,6 +406,28 @@ type LinuxDeviceCgroup struct {
|
|
Access string `json:"access,omitempty"`
|
|
Access string `json:"access,omitempty"`
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// LinuxPersonalityDomain refers to a personality domain.
|
|
|
|
+type LinuxPersonalityDomain string
|
|
|
|
+
|
|
|
|
+// LinuxPersonalityFlag refers to an additional personality flag. None are currently defined.
|
|
|
|
+type LinuxPersonalityFlag string
|
|
|
|
+
|
|
|
|
+// Define domain and flags for Personality
|
|
|
|
+const (
|
|
|
|
+ // PerLinux is the standard Linux personality
|
|
|
|
+ PerLinux LinuxPersonalityDomain = "LINUX"
|
|
|
|
+ // PerLinux32 sets personality to 32 bit
|
|
|
|
+ PerLinux32 LinuxPersonalityDomain = "LINUX32"
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+// LinuxPersonality represents the Linux personality syscall input
|
|
|
|
+type LinuxPersonality struct {
|
|
|
|
+ // Domain for the personality
|
|
|
|
+ Domain LinuxPersonalityDomain `json:"domain"`
|
|
|
|
+ // Additional flags
|
|
|
|
+ Flags []LinuxPersonalityFlag `json:"flags,omitempty"`
|
|
|
|
+}
|
|
|
|
+
|
|
// Solaris contains platform-specific configuration for Solaris application containers.
|
|
// Solaris contains platform-specific configuration for Solaris application containers.
|
|
type Solaris struct {
|
|
type Solaris struct {
|
|
// SMF FMRI which should go "online" before we start the container process.
|
|
// SMF FMRI which should go "online" before we start the container process.
|
|
@@ -555,12 +597,16 @@ type VMImage struct {
|
|
type LinuxSeccomp struct {
|
|
type LinuxSeccomp struct {
|
|
DefaultAction LinuxSeccompAction `json:"defaultAction"`
|
|
DefaultAction LinuxSeccompAction `json:"defaultAction"`
|
|
Architectures []Arch `json:"architectures,omitempty"`
|
|
Architectures []Arch `json:"architectures,omitempty"`
|
|
|
|
+ Flags []LinuxSeccompFlag `json:"flags,omitempty"`
|
|
Syscalls []LinuxSyscall `json:"syscalls,omitempty"`
|
|
Syscalls []LinuxSyscall `json:"syscalls,omitempty"`
|
|
}
|
|
}
|
|
|
|
|
|
// Arch used for additional architectures
|
|
// Arch used for additional architectures
|
|
type Arch string
|
|
type Arch string
|
|
|
|
|
|
|
|
+// LinuxSeccompFlag is a flag to pass to seccomp(2).
|
|
|
|
+type LinuxSeccompFlag string
|
|
|
|
+
|
|
// Additional architectures permitted to be used for system calls
|
|
// Additional architectures permitted to be used for system calls
|
|
// By default only the native architecture of the kernel is permitted
|
|
// By default only the native architecture of the kernel is permitted
|
|
const (
|
|
const (
|
|
@@ -589,11 +635,13 @@ type LinuxSeccompAction string
|
|
|
|
|
|
// Define actions for Seccomp rules
|
|
// Define actions for Seccomp rules
|
|
const (
|
|
const (
|
|
- ActKill LinuxSeccompAction = "SCMP_ACT_KILL"
|
|
|
|
- ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP"
|
|
|
|
- ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO"
|
|
|
|
- ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE"
|
|
|
|
- ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW"
|
|
|
|
|
|
+ ActKill LinuxSeccompAction = "SCMP_ACT_KILL"
|
|
|
|
+ ActKillProcess LinuxSeccompAction = "SCMP_ACT_KILL_PROCESS"
|
|
|
|
+ ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP"
|
|
|
|
+ ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO"
|
|
|
|
+ ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE"
|
|
|
|
+ ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW"
|
|
|
|
+ ActLog LinuxSeccompAction = "SCMP_ACT_LOG"
|
|
)
|
|
)
|
|
|
|
|
|
// LinuxSeccompOperator used to match syscall arguments in Seccomp
|
|
// LinuxSeccompOperator used to match syscall arguments in Seccomp
|
|
@@ -620,9 +668,10 @@ type LinuxSeccompArg struct {
|
|
|
|
|
|
// LinuxSyscall is used to match a syscall in Seccomp
|
|
// LinuxSyscall is used to match a syscall in Seccomp
|
|
type LinuxSyscall struct {
|
|
type LinuxSyscall struct {
|
|
- Names []string `json:"names"`
|
|
|
|
- Action LinuxSeccompAction `json:"action"`
|
|
|
|
- Args []LinuxSeccompArg `json:"args,omitempty"`
|
|
|
|
|
|
+ Names []string `json:"names"`
|
|
|
|
+ Action LinuxSeccompAction `json:"action"`
|
|
|
|
+ ErrnoRet *uint `json:"errnoRet,omitempty"`
|
|
|
|
+ Args []LinuxSeccompArg `json:"args,omitempty"`
|
|
}
|
|
}
|
|
|
|
|
|
// LinuxIntelRdt has container runtime resource constraints for Intel RDT
|
|
// LinuxIntelRdt has container runtime resource constraints for Intel RDT
|