Dev Containers
nf-core repositories offer Development Container (dev container) configurations. Dev containers offer a portable development environment that can be executed in a web browser, such as cloud-based GitHub Codespaces or local Visual Studio Code. These environments package all required software in isolated, containerised spaces for development.
Devcontainers are not required to run or develop nf-core pipelines. However, some may find dev containers useful for these purposes.
Set up in GitHub Codespaces
GitHub Codespaces provides a browser-based development platform that resembles local VS Code. The free tier allows up to 120 hours monthly for basic compute instances. Pipeline repositories use 4-core machines with 16GB RAM and 32GB storage.
To launch a Codespace:
- Navigate to any nf-core pipeline repository on GitHub
- Click the green Code button
- Select the Codespaces tab
- Click Create codespace
Select the 4-CPU hardware option for adequate performance.
No additional setup is required beyond a GitHub account. Git comes preinstalled in the environment and Codespaces automatically configures authentication via GitHub.
Set up in Visual Studio Code
To run Dev Containers locally in VS Code:
- Install Docker Desktop
- Install VS Code
- Install the VS Code Remote Development Extension
- Clone the repository in a container volume
Local VS Code Dev Containers require additional SSH key forwarding setup for remote repository access.
Testing your environment
Once the containerised environment loads, run workflows using the singularity profile:
nf-core --versionAnd try running a test pipeline.
Further Configuration
The .devcontainer/devcontainer.json file serves as the main configuration manifest, that describes the container environment to install and how it should be configured.
Pre-built image contents
The Dev Containers uses nfcore/devcontainer:latest and includes:
- Python
- nf-core tools
- Nextflow
- nf-test
- Apptainer
- Docker (via docker-outside-of-docker feature)
- Pre-installed VS Code extensions for Python, linting, and nf-core development
See nf-core extension pack for more information about VS Code packages.
Troubleshooting
SKU name errors when creating Codespaces
Problem:
SKU name errors when creating a Codespace.
Cause:
Incorrect hardware option selected.
Solution:
Select the 4-CPU hardware option.
Docker daemon connection failures
Problem:
Connection failures to the Docker daemon.
Cause:
Using -profile docker in the Dev Containers environment.
Solution:
Use -profile singularity instead.
Singularity permission errors
Problem:
Singularity permission errors.
Cause:
Missing privileges in the Dev Containers configuration.
Solution:
Add "privileged": true to the devcontainer.json file.