From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJN02-0006Hw-DP for qemu-devel@nongnu.org; Thu, 17 May 2018 13:47:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJN01-0003YY-Ft for qemu-devel@nongnu.org; Thu, 17 May 2018 13:47:34 -0400 Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]:42860) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJN01-0003YH-8m for qemu-devel@nongnu.org; Thu, 17 May 2018 13:47:33 -0400 Received: by mail-wr0-x234.google.com with SMTP id t16-v6so3367974wrm.9 for ; Thu, 17 May 2018 10:47:33 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 17 May 2018 18:46:39 +0100 Message-Id: <20180517174718.10107-11-alex.bennee@linaro.org> In-Reply-To: <20180517174718.10107-1-alex.bennee@linaro.org> References: <20180517174718.10107-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v4 10/49] docker: allow "cc" command to run in user context List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Cc: qemu-devel@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Signed-off-by: Alex Bennée Reviewed-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/docker/docker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 59bce9f19a..37bfa98005 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -417,6 +417,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""") @@ -430,6 +432,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) -- 2.17.0