Skip to content

Commit bb968d3

Browse files
authored
Merge pull request #222 from denis-yuen/disable_user
Allow disabling matching the container user to the running user
2 parents 1bfe6bd + 875ba00 commit bb968d3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cwltool/job.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ def run(self, dry_run=False, pull_image=True, rm_container=True,
172172
runtime.append("--log-driver=none")
173173

174174
euid = docker_vm_uid() or os.geteuid()
175-
runtime.append(u"--user=%s" % (euid))
175+
176+
if kwargs.get("no_match_user",None) is False:
177+
runtime.append(u"--user=%s" % (euid))
176178

177179
if rm_container:
178180
runtime.append("--rm")

cwltool/main.py

+2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
156156

157157
parser.add_argument("--default-container",
158158
help="Specify a default docker container that will be used if the workflow fails to specify one.")
159+
parser.add_argument("--no-match-user", action="store_true",
160+
help="Disable passing the current uid to 'docker run --user`")
159161
parser.add_argument("--disable-net", action="store_true",
160162
help="Use docker's default networking for containers;"
161163
" the default is to enable networking.")

0 commit comments

Comments
 (0)