mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-31 22:33:53 -06:00
docker.py: add --run-as-current-user
(podman will need further tweaks) Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
8109234808
commit
2461d80e6c
2 changed files with 6 additions and 1 deletions
|
@ -333,8 +333,13 @@ class RunCommand(SubCommand):
|
|||
def args(self, parser):
|
||||
parser.add_argument("--keep", action="store_true",
|
||||
help="Don't remove image when command completes")
|
||||
parser.add_argument("--run-as-current-user", action="store_true",
|
||||
help="Run container using the current user's uid")
|
||||
|
||||
def run(self, args, argv):
|
||||
if args.run_as_current_user:
|
||||
uid = os.getuid()
|
||||
argv = [ "-u", str(uid) ] + argv
|
||||
return Docker().run(argv, args.keep, quiet=args.quiet)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue