-
Notifications
You must be signed in to change notification settings - Fork 87
Initial draft virtualization (#69) #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,193 @@ | ||
| # Your version: 0.6.0 Latest version: 0.6.0 | ||
| # Generated by Neurodocker version 0.6.0 | ||
| # Timestamp: 2020-02-19 19:32:31 UTC | ||
| # | ||
| # Thank you for using Neurodocker. If you discover any issues | ||
| # or ways to improve this software, please submit an issue or | ||
| # pull request on our GitHub repository: | ||
| # | ||
| # https://github.com/kaczmarj/neurodocker | ||
|
|
||
| FROM ubuntu:latest | ||
|
|
||
| ARG DEBIAN_FRONTEND="noninteractive" | ||
|
|
||
| ENV LANG="en_US.UTF-8" \ | ||
| LC_ALL="en_US.UTF-8" \ | ||
| ND_ENTRYPOINT="/neurodocker/startup.sh" | ||
| RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \ | ||
| && apt-get update -qq \ | ||
| && apt-get install -y -q --no-install-recommends \ | ||
| apt-utils \ | ||
| bzip2 \ | ||
| ca-certificates \ | ||
| curl \ | ||
| locales \ | ||
| unzip \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ | ||
| && dpkg-reconfigure --frontend=noninteractive locales \ | ||
| && update-locale LANG="en_US.UTF-8" \ | ||
| && chmod 777 /opt && chmod a+s /opt \ | ||
| && mkdir -p /neurodocker \ | ||
| && if [ ! -f "$ND_ENTRYPOINT" ]; then \ | ||
| echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \ | ||
| && echo 'set -e' >> "$ND_ENTRYPOINT" \ | ||
| && echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \ | ||
| && echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \ | ||
| fi \ | ||
| && chmod -R 777 /neurodocker && chmod a+s /neurodocker | ||
|
Comment on lines
+32
to
+40
|
||
|
|
||
| ENTRYPOINT ["/neurodocker/startup.sh"] | ||
|
|
||
| RUN bash -c 'apt-get update' | ||
|
|
||
| RUN apt-get update -qq \ | ||
| && apt-get install -y -q --no-install-recommends \ | ||
| git \ | ||
| libsm6 \ | ||
| libxext6 \ | ||
| libgl1-mesa-dev \ | ||
| libvtk6.3 \ | ||
| xvfb \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| USER root | ||
|
|
||
| RUN bash -c 'curl https://raw.githubusercontent.com/PeerHerholz/BrainSpace/initial_draft_virtualization/requirements.txt > requirements.txt && chmod 777 requirements.txt' | ||
|
|
||
| RUN test "$(getent passwd brainspace)" || useradd --no-user-group --create-home --shell /bin/bash brainspace | ||
|
Comment on lines
+59
to
+61
|
||
| USER brainspace | ||
|
|
||
| ENV CONDA_DIR="/opt/miniconda-latest" \ | ||
| PATH="/opt/miniconda-latest/bin:$PATH" | ||
| RUN export PATH="/opt/miniconda-latest/bin:$PATH" \ | ||
| && echo "Downloading Miniconda installer ..." \ | ||
| && conda_installer="/tmp/miniconda.sh" \ | ||
| && curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ | ||
| && bash "$conda_installer" -b -p /opt/miniconda-latest \ | ||
| && rm -f "$conda_installer" \ | ||
| && conda update -yq -nbase conda \ | ||
| && conda config --system --prepend channels conda-forge \ | ||
| && conda config --system --set auto_update_conda false \ | ||
| && conda config --system --set show_channel_urls true \ | ||
| && sync && conda clean --all && sync \ | ||
| && conda create -y -q --name brainspace \ | ||
| && conda install -y -q --name brainspace \ | ||
| "python=3.7" \ | ||
| "panel" \ | ||
| "pyqt" \ | ||
| "pyvista" \ | ||
| "notebook" \ | ||
| "ipython" \ | ||
| && sync && conda clean --all && sync \ | ||
| && bash -c "source activate brainspace \ | ||
| && pip install --no-cache-dir \ | ||
| "-r" \ | ||
| "requirements.txt" \ | ||
| "git+https://github.com/PeerHerholz/BrainSpace.git@notebook_binder_support" \ | ||
| "xvfbwrapper" \ | ||
| "ipywidgets" \ | ||
| "ipyevents" \ | ||
| "jupytext" \ | ||
| "seaborn"" \ | ||
| && rm -rf ~/.cache/pip/* \ | ||
| && sync \ | ||
| && sed -i '$isource activate brainspace' $ND_ENTRYPOINT | ||
|
|
||
| RUN mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py | ||
|
|
||
| ENTRYPOINT ["/neurodocker/startup.sh"] | ||
|
|
||
|
Comment on lines
+100
to
+103
|
||
| WORKDIR /opt/miniconda-latest/envs/brainspace/lib/python3.7/site-packages/brainspace/examples | ||
|
|
||
| RUN sed -i '$ijupytext --set-formats ipynb,py *.py && rm *.ipynb' $ND_ENTRYPOINT | ||
|
|
||
| CMD ["jupyter", "notebook"] | ||
|
|
||
| RUN echo '{ \ | ||
| \n "pkg_manager": "apt", \ | ||
| \n "instructions": [ \ | ||
| \n [ \ | ||
| \n "base", \ | ||
| \n "ubuntu:latest" \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "run_bash", \ | ||
| \n "apt-get update" \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "install", \ | ||
| \n [ \ | ||
| \n "git", \ | ||
| \n "libsm6", \ | ||
| \n "libxext6", \ | ||
| \n "libgl1-mesa-dev", \ | ||
| \n "libvtk6.3", \ | ||
| \n "xvfb" \ | ||
| \n ] \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "user", \ | ||
| \n "root" \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "run_bash", \ | ||
| \n "curl https://raw.githubusercontent.com/PeerHerholz/BrainSpace/initial_draft_virtualization/requirements.txt > requirements.txt && chmod 777 requirements.txt" \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "user", \ | ||
| \n "brainspace" \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "miniconda", \ | ||
| \n { \ | ||
| \n "conda_install": [ \ | ||
| \n "python=3.7", \ | ||
| \n "panel", \ | ||
| \n "pyqt", \ | ||
| \n "pyvista", \ | ||
| \n "notebook", \ | ||
| \n "ipython" \ | ||
| \n ], \ | ||
| \n "pip_install": [ \ | ||
| \n "-r", \ | ||
| \n "requirements.txt", \ | ||
| \n "git+https://github.com/PeerHerholz/BrainSpace.git@notebook_binder_support", \ | ||
| \n "xvfbwrapper", \ | ||
| \n "ipywidgets", \ | ||
| \n "ipyevents", \ | ||
| \n "jupytext", \ | ||
| \n "seaborn" \ | ||
| \n ], \ | ||
| \n "create_env": "brainspace", \ | ||
| \n "activate": true \ | ||
| \n } \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "run", \ | ||
| \n "mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \\\"0.0.0.0\\\" > ~/.jupyter/jupyter_notebook_config.py" \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "entrypoint", \ | ||
| \n "/neurodocker/startup.sh" \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "workdir", \ | ||
| \n "/opt/miniconda-latest/envs/brainspace/lib/python3.7/site-packages/brainspace/examples" \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "add_to_entrypoint", \ | ||
| \n "jupytext --set-formats ipynb,py *.py && rm *.ipynb" \ | ||
| \n ], \ | ||
| \n [ \ | ||
| \n "cmd", \ | ||
| \n [ \ | ||
| \n "jupyter", \ | ||
| \n "notebook" \ | ||
| \n ] \ | ||
| \n ] \ | ||
| \n ] \ | ||
| \n}' > /neurodocker/neurodocker_specs.json | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,193 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Your version: 0.6.0 Latest version: 0.6.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Generated by Neurodocker version 0.6.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Timestamp: 2020-02-19 19:32:33 UTC | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Thank you for using Neurodocker. If you discover any issues | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # or ways to improve this software, please submit an issue or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # pull request on our GitHub repository: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # https://github.com/kaczmarj/neurodocker | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bootstrap: docker | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| From: ubuntu:latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+13
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| %post | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export ND_ENTRYPOINT="/neurodocker/startup.sh" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get update -qq | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get install -y -q --no-install-recommends \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-utils \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bzip2 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ca-certificates \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| locales \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| unzip | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get clean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dpkg-reconfigure --frontend=noninteractive locales | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| update-locale LANG="en_US.UTF-8" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chmod 777 /opt && chmod a+s /opt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p /neurodocker | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ ! -f "$ND_ENTRYPOINT" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo 'set -e' >> "$ND_ENTRYPOINT" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chmod -R 777 /neurodocker && chmod a+s /neurodocker | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bash -c 'apt-get update' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get update -qq | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get install -y -q --no-install-recommends \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libsm6 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libxext6 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libgl1-mesa-dev \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libvtk6.3 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xvfb | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-get clean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| su - root | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bash -c 'curl https://raw.githubusercontent.com/PeerHerholz/BrainSpace/initial_draft_virtualization/requirements.txt > requirements.txt && chmod 777 requirements.txt' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bash -c 'curl https://raw.githubusercontent.com/PeerHerholz/BrainSpace/initial_draft_virtualization/requirements.txt > requirements.txt && chmod 777 requirements.txt' | |
| bash -c 'curl https://raw.githubusercontent.com/PeerHerholz/BrainSpace/abcdef1234567890abcdef1234567890abcdef12/requirements.txt > requirements.txt && chmod 777 requirements.txt' |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The %post section uses su - root / su - brainspace without -c, which relies on stdin/script parsing behavior and makes it harder to reason about which user runs subsequent commands. Consider replacing these with explicit su -c '...' brainspace (or runuser) blocks so user context is unambiguous and less brittle across build environments.
| su - root | |
| bash -c 'curl https://raw.githubusercontent.com/PeerHerholz/BrainSpace/initial_draft_virtualization/requirements.txt > requirements.txt && chmod 777 requirements.txt' | |
| test "$(getent passwd brainspace)" || useradd --no-user-group --create-home --shell /bin/bash brainspace | |
| su - brainspace | |
| export PATH="/opt/miniconda-latest/bin:$PATH" | |
| echo "Downloading Miniconda installer ..." | |
| conda_installer="/tmp/miniconda.sh" | |
| curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh | |
| bash "$conda_installer" -b -p /opt/miniconda-latest | |
| rm -f "$conda_installer" | |
| conda update -yq -nbase conda | |
| conda config --system --prepend channels conda-forge | |
| conda config --system --set auto_update_conda false | |
| conda config --system --set show_channel_urls true | |
| sync && conda clean --all && sync | |
| conda create -y -q --name brainspace | |
| conda install -y -q --name brainspace \ | |
| "python=3.7" \ | |
| "panel" \ | |
| "pyqt" \ | |
| "pyvista" \ | |
| "notebook" \ | |
| "ipython" | |
| sync && conda clean --all && sync | |
| bash -c 'curl https://raw.githubusercontent.com/PeerHerholz/BrainSpace/initial_draft_virtualization/requirements.txt > requirements.txt && chmod 777 requirements.txt' | |
| test "$(getent passwd brainspace)" || useradd --no-user-group --create-home --shell /bin/bash brainspace | |
| su - brainspace -c "export PATH=\"/opt/miniconda-latest/bin:\$PATH\"; echo \"Downloading Miniconda installer ...\"; conda_installer=\"/tmp/miniconda.sh\"; curl -fsSL --retry 5 -o \"\$conda_installer\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh; bash \"\$conda_installer\" -b -p /opt/miniconda-latest; rm -f \"\$conda_installer\"; conda update -yq -nbase conda; conda config --system --prepend channels conda-forge; conda config --system --set auto_update_conda false; conda config --system --set show_channel_urls true; sync && conda clean --all && sync; conda create -y -q --name brainspace; conda install -y -q --name brainspace python=3.7 panel pyqt pyvista notebook ipython; sync && conda clean --all && sync" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
ubuntu:latestmakes builds non-deterministic and can break unexpectedly over time (especially with versioned apt packages likelibvtk6.3). Pin the base image to a specific Ubuntu release (or digest) that you’ve verified works.