nf-core / nf-core/tools

Write permission error when running "download" with docker as non-root user

Open
#1,318 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug command line tools
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

Description of the bug

I get a permission error when running the nf-core download command through Docker with the -u option to set the user & group IDs (as described in the docs https://nf-co.re/tools/#installation).

This is a minor problem, because it works fine without -u.

Steps to reproduce

Steps to reproduce the behaviour:

  1. Command line:
docker run -itv `pwd`:`pwd` -w `pwd` -u $(id -u):$(id -g)  nfcore/tools:dev download --singularity-cache-copy -c singularity -x tar.gz rnaseq


? Select release / branch: 3.4  [release]
? Define $NXF_SINGULARITY_CACHEDIR for a shared Singularity image download folder? [y/n]: n
  1. See error:
AssertionError: Command 'nextflow config -flat nf-core-rnaseq-3.4/workflow' returned non-zero error code '1':
[red]> mkdir: cannot create directory ‘//.nextflow’: Permission denied
mkdir: cannot create directory ‘//.nextflow’: Permission denied

Expected behaviour

It downloads the pipeline.

System

  • Hardware: Mac Mini
  • Executor: Docker
  • OS: macOS 11.6.1
  • Version of nf-core/tools: nf-core/tools version 2.2.dev0 (and earlier)
  • Python version: N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented docker run ... nfcore/tools:dev download command with -u, then trace the download entry point where it invokes nextflow config -flat. Check how the working directory and .nextflow location are selected for a non-root user; done means the command downloads the pipeline without the permission error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.