コード例 #1
0
ファイル: config.go プロジェクト: WeiZhang555/oct
func RootFrom(image schema.ImageManifest, msgs []string) (specs.Root, []string) {
	var r specs.Root
	r.Path = "rootfs"
	//Default to 'false'
	r.Readonly = false
	msg := fmt.Sprintf("root readonly is not exist in aci-0.6.1")
	msgs = append(msgs, msg)
	return r, msgs
}
コード例 #2
0
ファイル: gen.go プロジェクト: WeiZhang555/oct
func genConfig() (ls specs.LinuxSpec) {
	var s specs.Spec
	var plat specs.Platform
	var user specs.User
	var pro specs.Process
	var root specs.Root

	s.Version = sv.Version

	plat.OS = "linux"
	plat.Arch = "x86"
	s.Platform = plat

	user.UID = 0
	user.GID = 0
	pro.Terminal = false
	pro.User = user
	pro.Args = []string{
		"/usr/bin/ls",
		"-al",
	}
	//	pro.Env = []
	pro.Cwd = "/tmp"
	s.Process = pro

	root.Path = "rootfs"
	root.Readonly = false
	s.Root = root

	s.Hostname = "demohost"
	s.Mounts = []specs.MountPoint{
		{"sys", "/sys"},
		{"proc", "/proc"},
		{"dev", "/dev"},
		{"devpts", "/dev/pts"},
		{"devshm", "/dev/shm"},
	}

	ls.Spec = s

	var l specs.Linux
	l.Capabilities = []string{
		"CAP_AUDIT_WRITE",
		"CAP_KILL",
		"CAP_NET_BIND_SERVICE",
	}

	ls.Linux = l

	return ls
}