container

package
v0.0.0-...-dd160b1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const OLD_ROOTFS = "oldrootfs"

Variables

View Source
var DefaultHostMounts = []HostMountOption{
	{
		Src:   "/proc",
		Flags: 0,
		Type:  "proc",
	},
	{
		Src:   "/dev",
		Flags: syscall.MS_BIND | syscall.MS_PRIVATE,
		Type:  "dev",
	},
	{
		Src:   "/sys",
		Flags: syscall.MS_BIND | syscall.MS_PRIVATE,
		Type:  "sys",
	},
	{
		Src:   "/etc/resolv.conf",
		Flags: syscall.MS_BIND | syscall.MS_RDONLY | syscall.MS_PRIVATE,
		Type:  "",
	},
	{
		Src:   "/etc/passwd",
		Flags: syscall.MS_BIND | syscall.MS_RDONLY | syscall.MS_PRIVATE,
		Type:  "",
	},
	{
		Src:   "/etc/group",
		Flags: syscall.MS_BIND | syscall.MS_RDONLY | syscall.MS_PRIVATE,
		Type:  "",
	},
	{
		Src:                 "/etc/hostname",
		Flags:               syscall.MS_BIND | syscall.MS_RDONLY | syscall.MS_PRIVATE,
		Type:                "",
		IgnoreNoSourceError: true,
	},
	{
		Src:   "/etc/hosts",
		Flags: syscall.MS_BIND | syscall.MS_RDONLY | syscall.MS_PRIVATE,
		Type:  "",
	},
	{
		Src:   "/var/run",
		Flags: syscall.MS_BIND | syscall.MS_RDONLY | syscall.MS_PRIVATE,
		Type:  "",
	},
	{
		Src:   "/var/log/wtmp",
		Flags: syscall.MS_BIND | syscall.MS_RDONLY | syscall.MS_PRIVATE,
		Type:  "",
	},
}

Functions

func CheckRoot

func CheckRoot() bool

func PrepareMountTargets

func PrepareMountTargets(rootfs string, options []HostMountOption) error

TODO: root で実行する必要があるため、pullの段階で準備する

Types

type HostMountOption

type HostMountOption struct {
	Src                 string
	Flags               uintptr
	Type                string
	IgnoreNoSourceError bool
}

type SLCClient

type SLCClient struct {
	MountOptions []HostMountOption
	// contains filtered or unexported fields
}

func NewClient

func NewClient(stateDir string) (*SLCClient, error)

func (*SLCClient) Clear

func (c *SLCClient) Clear() error

func (*SLCClient) GetImageDir

func (c *SLCClient) GetImageDir(image string) string

func (*SLCClient) Pull

func (c *SLCClient) Pull(image string) error

func (*SLCClient) Remove

func (c *SLCClient) Remove(image string) error

func (*SLCClient) Run

func (c *SLCClient) Run(image string, argv []string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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