diff --git a/cwltool/job.py b/cwltool/job.py index 632174507..bf62577ac 100644 --- a/cwltool/job.py +++ b/cwltool/job.py @@ -69,7 +69,8 @@ def run(self, dry_run=False, pull_image=True, rm_container=True, rm_tmpdir=True, runtime.append("--read-only=true") runtime.append("--net=none") euid = docker_vm_uid() or os.geteuid() - runtime.append("--user=%s" % (euid)) + if kwargs.get("no_user") is not True: + runtime.append("--user=%s" % (euid)) if rm_container: runtime.append("--rm") diff --git a/cwltool/main.py b/cwltool/main.py index 584711e16..542f58ff5 100755 --- a/cwltool/main.py +++ b/cwltool/main.py @@ -115,6 +115,7 @@ def arg_parser(): exgroup.add_argument("--debug", action="store_true", help="Print even more logging") parser.add_argument("--tool-help", action="store_true", help="Print command line help for tool") + parser.add_argument("--no-user", action="store_true", help="Runs container without setting user (default will set user)") parser.add_argument("workflow", type=str, nargs="?", default=None) parser.add_argument("job_order", nargs=argparse.REMAINDER) @@ -535,6 +536,7 @@ def main(args=None, outdir=args.outdir, tmp_outdir_prefix=args.tmp_outdir_prefix, use_container=args.use_container, + no_user=args.no_user, preserve_environment=args.preserve_environment, pull_image=args.enable_pull, rm_container=args.rm_container,