container

package
v0.0.0-...-5b18574 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BusyboxRoot = "/var/local/busybox"
)

Paths used across container lifecycle for overlayfs and volume handling.

View Source
const (
	DefaultContainerLogFileName = "container.log"
)
View Source
const ExecTargetPidEnv = "TINYDOCKER_EXEC_PID"

Variables

This section is empty.

Functions

func Exec

func Exec(name string, args []string, enableTTY bool) error

Exec runs a command inside a running container identified by name. It re-execs the current binary with the hidden command "exec-container", passing the target container's init PID via env for the child to join namespaces.

func ExecContainer

func ExecContainer(args cli.Args) error

ExecContainer is the internal entrypoint to join target namespaces and run the user command. It expects env TINYDOCKER_EXEC_PID to be set and args to contain the command to run.

func GetContainerInfoByName

func GetContainerInfoByName(name string) (*models.Info, error)

func GetContainerMountPoint

func GetContainerMountPoint(containerId string) string

GetContainerMountPoint 根据容器ID获取挂载点路径

func InitContainerProcess

func InitContainerProcess() error

func NewInitProcess

func NewInitProcess(enableTTY bool, memoryLimit, cpuLimit, volume string, info *models.Info, envVars []string) (*exec.Cmd, *os.File, error)

func PrintContainerLogs

func PrintContainerLogs(containerID string, follow bool) error

func Remove

func Remove(containerName string, force bool) error

Remove removes a container

func Run

func Run(args cli.Args, name string, enableTTY bool, detach bool,
	memoryLimit, cpuLimit, volume string, imageName string, envVars []string, net string, portMapping []string) error

func SendInitCommand

func SendInitCommand(cmd []string, write *os.File) error

func Stop

func Stop(containerName string) error

Stop stops a running container

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL