diff --git a/pipeline/config/methods.config b/pipeline/config/methods.config index c7ef8792..2a12475e 100644 --- a/pipeline/config/methods.config +++ b/pipeline/config/methods.config @@ -105,7 +105,11 @@ params { // Enable docker docker { enabled = true - sudo = params.sge_scheduler // Set to true if run on SGE - runOptions = "-u \$(id -u):\$(id -g)" - runOptions = "\$(for i in `id --real --groups`; do echo -n \"--group-add=\$i \"; done)" -} \ No newline at end of file + sudo = (params.sge_scheduler) ? true : false // Set to true if run on SGE + + // Pass user's UID/GID and group IDs to Docker + uid_and_gid = "-u \$(id -u):\$(id -g)" + all_group_ids = "\$(for i in `id --real --groups`; do echo -n \"--group-add=\$i \"; done)" + + runOptions = "${uid_and_gid} ${all_group_ids}" +}