Add modern Dockerfile for headless usage (#70)#159
Merged
Conversation
Replaces the 4-year-old Neurodocker draft in #70 (which pinned Python 3.7 EOL, pulled requirements from a fork branch, and won't build today) with a minimal current image: - python:3.11-slim base, non-root user - Installs BrainSpace from the in-repo source via pip install .[examples] (no fork URLs) - Replaces vtk with vtk-osmesa for headless software rendering, so plot_hemispheres works in Docker without an X display - Ships a Jupyter Lab server on port 8888 Apptainer users can derive a SIF directly: apptainer build brainspace.sif docker-daemon://brainspace:latest so the separate Singularity recipe from #70 is no longer needed. .dockerignore excludes build artifacts, tests, and IDE noise so the image stays small. Closes #70. Co-authored-by: Reinder Vos de Wael <ReinderVosDeWael@users.noreply.github.com> Co-authored-by: Peer Herholz <PeerHerholz@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the 4-year-old Neurodocker draft in #70.
Why not iterate on #70
The original draft was generated by Neurodocker 0.6.0 in 2020-02. It pins Python 3.7 (EOL since 2023-06),
ubuntu:latest(which has rolled 18.04 → 24.04 since the file was generated), pullsrequirements.txtfrom a fork branch at build time, andpip installs BrainSpace itself from a fork branch. None of those will resolve cleanly today, so reviving it is more work than starting fresh.What this is
Single ~50-line Dockerfile based on
python:3.11-slim:brainspace).pip install .[examples]— no fork URLs.vtkwithvtk-osmesasoplot_hemispheresworks without an X display in Docker.JUPYTER_TOKEN).What about Singularity / Apptainer?
The original PR included a separate Singularity recipe; that's no longer needed because Apptainer can build a SIF directly from a Docker image:
Test plan
pip install --dry-run -e ".[examples]"resolves cleanly with the metadata from Packaging metadata is stale and inconsistent (setup.py vs requirements.txt) #144.docker buildx build .succeeds locally — couldn't run from this environment; would appreciate a maintainer or CI run.docker run --rm brainspace python -c "import brainspace; print(brainspace.__version__)"succeeds.Closes #70. @ReinderVosDeWael / @PeerHerholz credited as Co-authors on the squashed commit.