diff --git a/exec.go b/exec.go index f3a22e091..62a4c5277 100644 --- a/exec.go +++ b/exec.go @@ -17,7 +17,7 @@ import ( var execCommand = cli.Command{ Name: "exec", Usage: "execute new process inside the container", - ArgsUsage: ` + ArgsUsage: ` -- [command options] Where "" is the name for the instance of the container and "" is the command to be executed in the container. @@ -149,6 +149,9 @@ func getProcess(context *cli.Context, bundle string) (*specs.Process, error) { } p := spec.Process p.Args = context.Args()[1:] + if len(p.Args) > 1 && p.Args[0] == "--" { + p.Args = p.Args[1:] + } // override the cwd, if passed if context.String("cwd") != "" { p.Cwd = context.String("cwd") diff --git a/man/runc-exec.8.md b/man/runc-exec.8.md index a1f8a3336..e47f82842 100644 --- a/man/runc-exec.8.md +++ b/man/runc-exec.8.md @@ -2,7 +2,7 @@ runc exec - execute new process inside the container # SYNOPSIS - runc exec [command options] + runc exec [command options] -- [args...] Where "" is the name for the instance of the container and "" is the command to be executed in the container.