MCPcopy
hub / github.com/opencontainers/runc / main

Function main

main.go:87–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85)
86
87func main() {
88 app := cli.NewApp()
89 app.Name = "runc"
90 app.Version = strings.TrimSpace(version) + extraVersion
91 app.Usage = usage
92
93 cli.VersionPrinter = printVersion
94
95 root := "/run/runc"
96 xdgDirUsed := false
97 xdgRuntimeDir := os.Getenv("XDG_RUNTIME_DIR")
98 if xdgRuntimeDir != "" && shouldHonorXDGRuntimeDir() {
99 root = xdgRuntimeDir + "/runc"
100 xdgDirUsed = true
101 }
102
103 app.Flags = []cli.Flag{
104 cli.BoolFlag{
105 Name: "debug",
106 Usage: "enable debug logging",
107 },
108 cli.StringFlag{
109 Name: "log",
110 Value: "",
111 Usage: "set the log file to write runc logs to (default is '/dev/stderr')",
112 },
113 cli.StringFlag{
114 Name: "log-format",
115 Value: "text",
116 Usage: "set the log format ('text' (default), or 'json')",
117 },
118 cli.StringFlag{
119 Name: "root",
120 Value: root,
121 Usage: "root directory for storage of container state (this should be located in tmpfs)",
122 },
123 cli.BoolFlag{
124 Name: "systemd-cgroup",
125 Usage: "enable systemd cgroup support, expects cgroupsPath to be of form \"slice:prefix:name\" for e.g. \"system.slice:runc:434234\"",
126 },
127 cli.StringFlag{
128 Name: "rootless",
129 Value: "auto",
130 Usage: "ignore cgroup permission errors ('true', 'false', or 'auto')",
131 },
132 }
133 app.Commands = []cli.Command{
134 checkpointCommand,
135 createCommand,
136 deleteCommand,
137 eventsCommand,
138 execCommand,
139 killCommand,
140 listCommand,
141 pauseCommand,
142 psCommand,
143 restoreCommand,
144 resumeCommand,

Callers

nothing calls this directly

Calls 5

shouldHonorXDGRuntimeDirFunction · 0.85
fatalFunction · 0.85
reviseRootDirFunction · 0.85
configLogrusFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…