container

package
v0.0.0-...-2e022c1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RUNNING             string = "running"
	STOP                string = "stopped"
	Exit                string = "exited"
	DefaultInfoLocation string = "/var/run/mydocker/%s/"
	ConfigName          string = "config.json"
	ContainerLogFile    string = "container.log"
	RootUrl             string = "/root"
	MntUrl              string = "/root/mnt/%s"
	WriteLayerUrl       string = "/root/writeLayer/%s"
)

Functions

func CreateMountPoint

func CreateMountPoint(containerName, imageName string) error

func CreateReadOnlyLayer

func CreateReadOnlyLayer(imageName string) error

Decompression tar image

func CreateWriteLayer

func CreateWriteLayer(containerName string)

func DeleteMountPoint

func DeleteMountPoint(containerName string) error

func DeleteVolume

func DeleteVolume(volumeURLs []string, containerName string) error

func DeleteWorkSpace

func DeleteWorkSpace(volume, containerName string)

Delete the AUFS filesystem while container exit

func DeleteWriteLayer

func DeleteWriteLayer(containerName string)

func MountVolume

func MountVolume(volumeURLs []string, containerName string) error

func NewParentProcess

func NewParentProcess(tty bool, containerName, volume, imageName string, envSlice []string) (*exec.Cmd, *os.File)

func NewPipe

func NewPipe() (*os.File, *os.File, error)

func NewWorkSpace

func NewWorkSpace(volume, imageName, containerName string)

Create a AUFS filesystem as container root workspace

func PathExists

func PathExists(path string) (bool, error)

func RunContainerInitProcess

func RunContainerInitProcess() error

Types

type ContainerInfo

type ContainerInfo struct {
	Pid         string   `json:"pid"`         //容器的init进程在宿主机上的 PID
	Id          string   `json:"id"`          //容器Id
	Name        string   `json:"name"`        //容器名
	Command     string   `json:"command"`     //容器内init运行命令
	CreatedTime string   `json:"createTime"`  //创建时间
	Status      string   `json:"status"`      //容器的状态
	Volume      string   `json:"volume"`      //容器的数据卷
	PortMapping []string `json:"portmapping"` //端口映射
}

Jump to

Keyboard shortcuts

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