/
instance_start_linux.go
71 lines (64 loc) · 1.48 KB
/
instance_start_linux.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (c) 2018-2019, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the
// LICENSE.md file distributed with the sources of this project regarding your
// rights to use or distribute this software.
package cli
import (
"github.com/spf13/cobra"
"github.com/sylabs/singularity/docs"
)
func init() {
options := []string{
"add-caps",
"allow-setuid",
"apply-cgroups",
"bind",
"boot",
"contain",
"containall",
"containlibs",
"cleanenv",
"docker-login",
"docker-username",
"docker-password",
"dns",
"drop-caps",
"fakeroot",
"home",
"hostname",
"keep-privs",
"net",
"network",
"network-args",
"no-home",
"no-nv",
"no-privs",
"nv",
"overlay",
"scratch",
"security",
"userns",
"uts",
"workdir",
"writable",
"writable-tmpfs",
}
for _, opt := range options {
InstanceStartCmd.Flags().AddFlag(actionFlags.Lookup(opt))
}
InstanceStartCmd.Flags().SetInterspersed(false)
}
// InstanceStartCmd singularity instance start
var InstanceStartCmd = &cobra.Command{
Args: cobra.MinimumNArgs(2),
PreRun: replaceURIWithImage,
DisableFlagsInUseLine: true,
Run: func(cmd *cobra.Command, args []string) {
a := append([]string{"/.singularity.d/actions/start"}, args[2:]...)
execStarter(cmd, args[0], a, args[1])
},
Use: docs.InstanceStartUse,
Short: docs.InstanceStartShort,
Long: docs.InstanceStartLong,
Example: docs.InstanceStartExample,
}