From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVt2t-0000um-2O for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:26:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVt2s-0000c9-5F for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:26:15 -0400 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:36153) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVt2r-0000b8-VX for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:26:14 -0400 Received: by mail-wm0-x22d.google.com with SMTP id v131-v6so3624934wma.1 for ; Wed, 20 Jun 2018 23:26:13 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 21 Jun 2018 07:25:16 +0100 Message-Id: <20180621062605.941-9-alex.bennee@linaro.org> In-Reply-To: <20180621062605.941-1-alex.bennee@linaro.org> References: <20180621062605.941-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PULL v2 08/57] docker: allow "cc" command to run in user context List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: qemu-devel@nongnu.org, 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, =?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é diff --git a/tests/docker/docker.py b/tests/docker/docker.py index db1e2537f5..b28ad87034 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -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) -- 2.17.1