Skip to content

Commit 0247000

Browse files
authored
Merge pull request #44 from inutano/fix/nextflow-nxf-home
fix(nextflow): redirect NXF_HOME into run_dir to fix child container mount errors
2 parents 9b7cdc9 + 12fda07 commit 0247000

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

sapporo/run.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ function run_cwltool() {
6060

6161
function run_nextflow() {
6262
local container="nextflow/nextflow:25.10.4"
63+
# Store NXF_HOME inside the run_dir so pipeline assets (bin/ scripts, etc.)
64+
# are on the host-mounted filesystem. Without this, Nextflow caches assets
65+
# inside the container at /.nextflow/, which is not visible to the host.
66+
# When child process containers are spawned, Nextflow tries to bind-mount
67+
# those asset paths from the host, causing "mounts denied" errors.
68+
local nxf_home="${run_dir}/nxf_home"
69+
mkdir -p "${nxf_home}"
6370
# Write a Nextflow config that propagates DOCKER_API_VERSION into child containers.
6471
# This is required on Docker Desktop >= 4.x where the minimum supported API version
6572
# is 1.44, but the Docker client bundled in nextflow/nextflow images reports 1.32.
@@ -71,6 +78,8 @@ NFCFG
7178
-v /var/run/docker.sock:/var/run/docker.sock
7279
-e DOCKER_HOST=unix:///var/run/docker.sock
7380
-e DOCKER_API_VERSION=1.44
81+
-e "NXF_HOME=${nxf_home}"
82+
-e "NXF_ASSETS=${nxf_home}/assets"
7483
-v "${run_dir}:${run_dir}"
7584
"-w=${exe_dir}"
7685
"${container}"

0 commit comments

Comments
 (0)