package namespaces

import "github.com/docker/docker/pkg/libcontainer/namespaces"

Index

Functions

func DeletePid

func DeletePid(path string) error

DeletePid removes the pid and started file from disk when the container's process dies and the container is cleanly removed

func Exec

func Exec(container *libcontainer.Container, term Terminal, rootfs, dataPath string, args []string, createCommand CreateCommand, startCallback func()) (int, error)

func GetNamespaceFlags

func GetNamespaceFlags(namespaces map[string]bool) (flag int)

func Init

func Init(container *libcontainer.Container, uncleanRootfs, consolePath string, syncPipe *SyncPipe, args []string) error

func InitializeNetworking

func InitializeNetworking(container *libcontainer.Container, nspid int, pipe *SyncPipe) error

func SetupCgroups

func SetupCgroups(container *libcontainer.Container, nspid int) (cgroups.ActiveCgroup, error)

func WritePid

func WritePid(path string, pid int, startTime string) error

WritePid writes the namespaced processes pid to pid and it's start time to the path specified

Types

type CreateCommand

type CreateCommand func(container *libcontainer.Container, console, rootfs, dataPath, init string, childPipe *os.File, args []string) *exec.Cmd

type StdTerminal

type StdTerminal struct {
	// contains filtered or unexported fields
}

func (*StdTerminal) Attach

func (s *StdTerminal) Attach(command *exec.Cmd) error

func (*StdTerminal) Close

func (s *StdTerminal) Close() error

func (*StdTerminal) Resize

func (s *StdTerminal) Resize(h, w int) error

func (*StdTerminal) SetMaster

func (s *StdTerminal) SetMaster(*os.File)

type SyncPipe

type SyncPipe struct {
	// contains filtered or unexported fields
}

SyncPipe allows communication to and from the child processes to it's parent and allows the two independent processes to syncronize their state.

func NewSyncPipe

func NewSyncPipe() (s *SyncPipe, err error)

func NewSyncPipeFromFd

func NewSyncPipeFromFd(parendFd, childFd uintptr) (*SyncPipe, error)

func (*SyncPipe) Child

func (s *SyncPipe) Child() *os.File

func (*SyncPipe) Close

func (s *SyncPipe) Close() error

func (*SyncPipe) Parent

func (s *SyncPipe) Parent() *os.File

func (*SyncPipe) ReadFromParent

func (s *SyncPipe) ReadFromParent() (libcontainer.Context, error)

func (*SyncPipe) SendToChild

func (s *SyncPipe) SendToChild(context libcontainer.Context) error

type Terminal

type Terminal interface {
	io.Closer
	SetMaster(*os.File)
	Attach(*exec.Cmd) error
	Resize(h, w int) error
}

func NewTerminal

func NewTerminal(stdin io.Reader, stdout, stderr io.Writer, tty bool) Terminal

type TtyTerminal

type TtyTerminal struct {
	// contains filtered or unexported fields
}

func (*TtyTerminal) Attach

func (t *TtyTerminal) Attach(command *exec.Cmd) error

func (*TtyTerminal) Close

func (t *TtyTerminal) Close() error

func (*TtyTerminal) Resize

func (t *TtyTerminal) Resize(h, w int) error

func (*TtyTerminal) SetMaster

func (t *TtyTerminal) SetMaster(master *os.File)

Source Files

create.go nsenter.go pid.go std_term.go sync_pipe.go term.go tty_term.go unsupported.go

Version
v0.12.0
Published
Jun 6, 2014
Platform
js/wasm
Imports
11 packages
Last checked
4 minutes ago

Tools for package owners.