container

package
v0.0.0-...-d6da5a7 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 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(rootURL string, mntURL string)

func CreateReadOnlyLayer

func CreateReadOnlyLayer(rootURL string)

把busybox.tar解压到busybox目录下,作为容器只读层

func CreateWriteLayer

func CreateWriteLayer(rootURL string)

func DeleteMountPoint

func DeleteMountPoint(rootURL string, mntURL string)

func DeleteMountPointWithVolume

func DeleteMountPointWithVolume(rootURL string, mntURL string, volumeURLs []string)

func DeleteWorkSpace

func DeleteWorkSpace(rootURL string, mntURL string, volume string)

func DeleteWriteLayer

func DeleteWriteLayer(rootURL string)

func MountVolume

func MountVolume(rootURL string, mntURL string, volumeURLs []string)

func NewParentProcess

func NewParentProcess(tty bool, volume string) (*exec.Cmd, *os.File)

func NewPipe

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

func NewWorkSpace

func NewWorkSpace(rootURL string, mntURL string, volume 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