-
Notifications
You must be signed in to change notification settings - Fork 0
Docker
Source: https://www.docker.com/resources/what-container
A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.
A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.
Most of the neuroimaging projects could probably be well implemented on alpine as OS / basic image. I prefer to use the operating system I know best to get everything up and running in the easiest way - Ubunto- but sure that's probably not always the best choice
If you are in your project folder and want to start the build of your image (here called docker file), make sure that you do not miss the "." to point to your location:
docker build -f Dockerfile -t TheConnectome .
To run your image and expose your Jupyter server for the volume you want to share, make sure you do not miss the "/" before "$(pwd)":
docker run -it -p 8888:8888 -d -v /$(pwd)/notebooks:/notebooks TheConnectome
VS code plugin makes a lot of things easier such as removing containers etc.
Docker container can be used to ship the final analysis and research results, but they can also be used as a development environment. I personally prefer to start a project from scratch in a single container.
I prefer to share the folder of the project (e.g. src) which contains all relevant scripts and data. This can be configured via VOLUME in the dockerimage
Moreover, I prototype via Jupyter notebooks and use the jupyter server of the dockerimage as a remote server to run notebooks from VS Code. Therefore, I expose the relevant port 8888 to 8888 (see dockerimage of this container) and configure jupyter notebook to use tokens. Next, I set the localhost:8888 with the defined token as the remote server in VS Code (see Connect to a remote Jupyter server
Another option is to connect VS Code directly to your container develop within your container.
Compose enables to run multi-container Docker applications. Hence, it is only relevant if you want to manage several containers in the same repo. This is probably not a common case in neuroscience projects but it is pretty easy and perhaps there is someday a use-case in your projects for such technology.