mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Add a 'start' command
When any non-global-flag parameter appears on the command line make sure there's a "command" even in the 'start' (run) case to ensure its not ambiguous as to what the arg is. For example, w/o this fix its not clear if runc foo means 'foo' is the name of a config file or an unknown command. Or worse, you can't name a config file the same a ANY command, even future (yet to be created) commands. We should fix this now before we ship 1.0 and are forced to support this ambiguous case for a long time. Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
@@ -24,7 +24,11 @@ After creating a spec for your root filesystem with runc, you can execute a
|
||||
container in your shell by running:
|
||||
|
||||
cd /mycontainer
|
||||
runc [ spec-file ]
|
||||
runc start
|
||||
|
||||
or
|
||||
cd /mycontainer
|
||||
runc start [ spec-file ]
|
||||
|
||||
If not specified, the default value for the 'spec-file' is 'config.json'. `
|
||||
)
|
||||
@@ -56,6 +60,7 @@ func main() {
|
||||
},
|
||||
}
|
||||
app.Commands = []cli.Command{
|
||||
startCommand,
|
||||
checkpointCommand,
|
||||
eventsCommand,
|
||||
restoreCommand,
|
||||
@@ -69,7 +74,8 @@ func main() {
|
||||
return nil
|
||||
}
|
||||
|
||||
app.Action = runAction
|
||||
// Default to 'start' is no command is specified
|
||||
app.Action = startCommand.Action
|
||||
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
logrus.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user