# Different containers for different processes (running nextflow in offline mode)

**URL:** <https://community.seqera.io/t/different-containers-for-different-processes-running-nextflow-in-offline-mode/2705>\
**Category:** Ask for help\
**Tags:** nextflow\
**Created:** [June 8, 2026, 10:35am UTC](https://community.seqera.io/t/different-containers-for-different-processes-running-nextflow-in-offline-mode/2705 "2026-06-08T10:35:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maulik\_Upadhyay](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/maulik_upadhyay/32/2500_2.png) [@Maulik\_Upadhyay](https://community.seqera.io/u/Maulik_Upadhyay)\
**Post date:** [June 8, 2026, 10:35am UTC](https://community.seqera.io/t/different-containers-for-different-processes-running-nextflow-in-offline-mode/2705/1 "2026-06-08T10:35:39Z")

</div>

I am trying to run a Nextflow workflow offline using two different Apptainer containers that are already downloaded and stored in my home directory.

The workflow is intended to use:

- One container exclusively for the Manta module/process.
- A second container for all other tools in the workflow.

I am encountering two issues:

1. **Container path not recognized globally**

2. **Process-specific container assignment not working**

Below is my configuration file:

````auto
apptainer {
enabled = true
autoMounts = true
}

process {
beforeScript = '''
mkdir -p "$PWD/nxf_tmp"
export TMPDIR="$PWD/nxf_tmp"
'''

```
//withName: '.*'{
// container = "${System.getenv('HOME')}/sv_caller_new.sif"
//}

 withName: '!.*POPGEN48_SV_CALLER:SV_CALLER:MANTA_GERMLINE' {
    container = "${System.getenv('HOME')}/sv_caller_new.sif"
}

withName: '.*POPGEN48_SV_CALLER:SV_CALLER:MANTA_GERMLINE' {
    container = "${System.getenv('HOME')}/manta_python.sif"
}

env{
        TMPDIR = '$PWD/nxf_tmp'
        TMP = '$PWD/nxf_tmp'
    }

resourceLimits = [
    time: 24.h
]
```

}

timeline {
enabled = true
file = "timeline.html"
overwrite = true
}

trace {
enabled = true
file = "trace.txt"
overwrite = true
}

````

I am using nextflow version: 25.04.6.5954

---

<div class="post-metadata">

**Author:** ![ewels](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/ewels/32/1_2.png) [@ewels](https://community.seqera.io/u/ewels)\
**Post date:** [June 8, 2026, 10:46am UTC](https://community.seqera.io/t/different-containers-for-different-processes-running-nextflow-in-offline-mode/2705/2 "2026-06-08T10:46:04Z")

</div>

It’s a bit difficult to help without seeing more of your pipeline. Can you elaborate on what is not working as expected? Is it crashing, or using the wrong container (if so, what processes are using which container?).

Note that it’s better practice to set the `NXF_APPTAINER_CACHEDIR` environment variable or the `apptainer.cacheDir` config option to specify where container images are stored, instead of using `${System.getenv('HOME')}` directly in your config like that. Also `process` declarations overwrite based on specificity, so the cleaner is to set a default for all processes and then just overwrite the one you need:

```auto
apptainer.cacheDir = ${System.getenv('HOME')}
process {
  container = "sv_caller_new"

  withName: '.*POPGEN48_SV_CALLER:SV_CALLER:MANTA_GERMLINE' {
    container = "manta_python"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Maulik\_Upadhyay](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/maulik_upadhyay/32/2500_2.png) [@Maulik\_Upadhyay](https://community.seqera.io/u/Maulik_Upadhyay)\
**Post date:** [June 8, 2026, 5:18pm UTC](https://community.seqera.io/t/different-containers-for-different-processes-running-nextflow-in-offline-mode/2705/3 "2026-06-08T17:18:13Z")

</div>

Please accept my apologies for not posting the questions in the required detaills, I have edited my question.

---

<div class="post-metadata">

**Author:** ![Maulik\_Upadhyay](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/maulik_upadhyay/32/2500_2.png) [@Maulik\_Upadhyay](https://community.seqera.io/u/Maulik_Upadhyay)\
**Post date:** [June 9, 2026, 2:05pm UTC](https://community.seqera.io/t/different-containers-for-different-processes-running-nextflow-in-offline-mode/2705/4 "2026-06-09T14:05:32Z")

</div>

Unfortunately, this solution does not work for this specific case.
