Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override setting --user option for docker run #47

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cwltool/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions cwltool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down