driver

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInfoLocation string = "/var/lib/gocker/%s/"
	ConfigName          string = "config.json"
	ContainerLogFile    string = "container.log"
	Dirver              string = "overlay"
	OverlayDir          string = "/var/lib/gocker/overlay/"
)

Variables

Functions

func CreateReadOnlyLayer

func CreateReadOnlyLayer(programUrl, containerID string) error

创建只读的lower层 复制一份可执行文件过来 以及执行文件的动态链接库 TODO: 支持java等的语言

func CreateWriteLayer

func CreateWriteLayer(containerID string) error

创建并挂载 work,upper,merged

func DeleteVolumes

func DeleteVolumes(volumeURLs []string, layName string) error

func DeleteWorkSpace

func DeleteWorkSpace(containerID string)

删除容器overlay filesystem(仅保留lower层

func DeleteWriteLayer

func DeleteWriteLayer(containerID string)

从磁盘上删除overlay层 一定要先unmount后才进行删除!!!

func Exec

func Exec(argv0 string, argv []string, envv []string) (err error)

Exec invokes the execve(2) system call.

func InitLog

func InitLog(sugar *zap.SugaredLogger)

func NewParentProcess

func NewParentProcess(tty bool, containerID, programUrl string, envSlice []string) (*exec.Cmd, *os.File)

func NewPipe

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

func NewWorkSpace

func NewWorkSpace(programUrl, containerID string)

创建一个overlay2的文件系统

func PathExists

func PathExists(path string) (bool, error)

判断文件/文件夹是否存在

func RunContainerInitProcess

func RunContainerInitProcess() error

这里的init函数是在容器内部执行的,进到这步的时候容器已经创建出来了 使用 mount 去挂载 proc 文件系统

func UnmountOverlay

func UnmountOverlay(overlayDir string) error

func WalkDir

func WalkDir(path string, info os.FileInfo, err error) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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