Skip to content

Data in the devcontainer

Accessing your data

In the devcontainer, you have access to everything located inside your workspace. For you, this means everything that comes bundled in the scilus/nf-neuro-tutorial repository. You can call commands to look outside this directory, like ls / or ls ~, but you won’t find what is on your computer. This is called isolation and is a core feature of containers. It does limit you, but it also means that you can break things (like deleting everything under /) without breaking your computer. Good news though, there are ways to give access to your data to the container.

Small dataset

The simpler way is to copy your data in the nf-neuro-tutorial directory on your computer. If you used VSCode to clone the repository, it’s the path you chose previously. This will make your data instantly available inside the devcontainer, since VScode connects your workspace, available in the editor, to the nf-neuro-tutorial directory at launch. This way, any modifications made from your computer reflect instantly inside the container (and vice-versa).

Large dataset

For larger datasets, too heavy to duplicate, copying is impractical. There are 2 ways to deal with this.

  1. Mounting paths in the devcontainer

    Define a new mount point in the devcontainer definition. You will find it in .devcontainer/devcontainer.json. Look for the mounts entry, near line 15. To define a mount point add the following in the mounts entry :

    {
    "source": "<source>",
    "target": "/workspaces/<target>",
    "type": "bind"
    }

    Replace <source> by the absolute path to the data on your computer and <target> with the name of the directory you’d like your data to be placed inside the container, under /workspaces.

  2. Piggyback on Nextflow

    Note that there is also a way to not copy data on your computer. A great feature of Nextflow is that it handles remote files quite well. By that, we mean HTTP links, amazon s3 buckets and even ftp links. If possible, define your inputs using those, you’ll find all the information needed in the Nextflow documentation.