Documentation
¶
Index ¶
- func CreateMountStubs(dir string, dests []string, uid, gid int) error
- func InjectProxyCA(rootfsPath string, caPEM []byte) (func() error, error)
- func MountStubsCleaner(ctx context.Context, dir string, mounts []Mount, recursive bool) func()
- func ReplaceEnv(env, replacement []string) []string
- func ValidContainerID(id string) error
- type Executor
- type HostIP
- type Meta
- type Mount
- type Mountable
- type MountableRef
- type ProcessInfo
- type WinSize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMountStubs ¶ added in v0.33.0
CreateMountStubs creates the directories that the container runtime would have created itself as mount points for dests. Destinations nested under another destination are skipped: the runtime sets the parent mount up first and creates those inside it, so they never become part of the rootfs.
This is for mounts that were dropped from the spec before it reached the runtime, so that the mount points left in the rootfs do not depend on whether the mount was dropped.
func InjectProxyCA ¶ added in v0.31.0
InjectProxyCA appends caPEM to the rootfs trust bundle used by common Linux TLS stacks and returns a cleanup that removes only the injected CA.
func MountStubsCleaner ¶ added in v0.8.0
func ReplaceEnv ¶ added in v0.33.0
ReplaceEnv removes entries whose names are present in replacement, then appends replacement in order.
func ValidContainerID ¶ added in v0.28.1
ValidContainerID validates that id is non-empty and contains only ASCII letters and digits.
Types ¶
type Executor ¶
type Executor interface {
// Run will start a container for the given process with rootfs, mounts.
// `id` is an optional name for the container so it can be referenced later via Exec.
// `started` is an optional channel that will be closed when the container setup completes and has started running.
Run(ctx context.Context, id string, rootfs Mount, mounts []Mount, process ProcessInfo, started chan<- struct{}) (resourcestypes.Recorder, error)
// Exec will start a process in container matching `id`. An error will be returned
// if the container failed to start (via Run) or has exited before Exec is called.
Exec(ctx context.Context, id string, process ProcessInfo) error
}
type Meta ¶
type Meta struct {
Args []string
Env []string
User string
Cwd string
Hostname string
Tty bool
ReadonlyRootFS bool
ExtraHosts []HostIP
Ulimit []*pb.Ulimit
CDIDevices []*pb.CDIDevice
CgroupParent string
LinuxResources *pb.LinuxResources
NetMode pb.NetMode
SecurityMode pb.SecurityMode
ValidExitCodes []int
Proxy *network.ProxyConfig
RemoveMountStubsRecursive bool
}
type Mountable ¶ added in v0.8.0
type Mountable interface {
Mount(ctx context.Context, readonly bool) (MountableRef, error)
}
type MountableRef ¶ added in v0.12.5
type ProcessInfo ¶ added in v0.8.0
type ProcessInfo struct {
Meta Meta
Stdin io.ReadCloser
Stdout, Stderr io.WriteCloser
Resize <-chan WinSize
Signal <-chan syscall.Signal
}