提交 50b72738 编写于 作者: A Alex Bennée

docker: allow "cc" command to run in user context

Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
Reviewed-by: NFam Zheng <famz@redhat.com>
Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
上级 99cfdb86
......@@ -421,6 +421,8 @@ class CcCommand(SubCommand):
help="The docker image in which to run cc")
parser.add_argument("--cc", default="cc",
help="The compiler executable to call")
parser.add_argument("--user",
help="The user-id to run under")
parser.add_argument("--source-path", "-s", nargs="*", dest="paths",
help="""Extra paths to (ro) mount into container for
reading sources""")
......@@ -434,6 +436,8 @@ class CcCommand(SubCommand):
if args.paths:
for p in args.paths:
cmd += ["-v", "%s:%s:ro,z" % (p, p)]
if args.user:
cmd += ["-u", args.user]
cmd += [args.image, args.cc]
cmd += argv
return Docker().command("run", cmd, args.quiet)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册