-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
93 lines (79 loc) · 3.13 KB
/
Dockerfile
File metadata and controls
93 lines (79 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# syntax=docker/dockerfile:1
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Build deps / libs requested
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
dc \
bc \
git \
g++ \
python3 \
python-is-python3 \
libeigen3-dev \
zlib1g-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libgl1-mesa-dev \
libfftw3-dev \
libtiff5-dev \
libpng-dev \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# ---- MRtrix3: clone, configure, build, and set PATH ----
ARG MRTRIX3_REPO=https://github.com/MRtrix3/mrtrix3.git
ARG MRTRIX3_REF=master
RUN git clone --depth 1 --branch "${MRTRIX3_REF}" "${MRTRIX3_REPO}" /opt/mrtrix3
WORKDIR /opt/mrtrix3
RUN ./configure && ./build
# Run MRtrix3's convenience script, but also set PATH explicitly for non-interactive shells
RUN ./set_path /etc/bash.bashrc
ENV MRTRIX3_HOME=/opt/mrtrix3
ENV PATH="/opt/mrtrix3/bin:${PATH}"
RUN apt-get update && apt-get install -y --no-install-recommends curl bzip2 && rm -rf /var/lib/apt/lists/*
WORKDIR /opt/fsl
ENV FSLDIR=/opt/fsl/fsl_install_dir
COPY getfsl.sh /opt/fsl/getfsl.sh
RUN chmod +x /opt/fsl/getfsl.sh && /opt/fsl/getfsl.sh
#RUN curl -Ls https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/getfsl.sh | bash -s -- -d /opt/fsl
# FSL (fslconda) installs to ~/fsl by default (root => /root/fsl). Ensure it's on PATH.
ENV PATH="${FSLDIR}/bin:${PATH}"
ENV FSLOUTPUTTYPE=NIFTI_GZ
# MRtrix writes temp files; Singularity rootfs is read-only.
RUN test -x "${FSLDIR}/bin/fslversion"
WORKDIR /opt/uv
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="/opt/uv" sh
# uv will be at /opt/uv/uv (per installer contract), so add it to PATH:
ENV PATH="/opt/uv:${PATH}"
# # ---- scil_env: Python 3.12 venv + packages (via uv) ----
# WORKDIR /opt/venvs/scil_env
# RUN uv python install 3.12
# RUN uv venv --python 3.12
# RUN . /opt/venvs/scil_env/.venv/bin/activate \
# && uv pip install --upgrade pip \
# && uv pip install nibabel
# ENV VIRTUAL_ENV=/opt/venvs/scil_env/.venv
# ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
# # ---- pipeline scripts ----
# WORKDIR /opt/pipeline
# COPY preprocessing.sh crop_dwi_to_mask_bbox.py tracking_from_labels.sh /opt/pipeline/
# COPY epoch=015-val_loss=val_loss=0.6512.ckpt /opt/pipeline/checkpoints/model.ckpt
# RUN chmod +x /opt/pipeline/preprocessing.sh /opt/pipeline/crop_dwi_to_mask_bbox.py /opt/pipeline/tracking_from_labels.sh
# COPY bundleparc/ /opt/bundleparc/
# WORKDIR /opt/bundleparc
# RUN chmod -R 755 /opt/bundleparc
# # BundleParc pins monai==1.3.0, which breaks on Python 3.12.
# # Use Python 3.11 for the BundleParc project environment.
# RUN uv python install 3.11
# RUN uv sync --python 3.11
# WORKDIR /opt/bundle_visualization
# COPY bundle_qa.py /opt/bundle_visualization/bundle_qa.py
# RUN chmod +x /opt/bundle_visualization/bundle_qa.py
# COPY pyproject_viz.toml /opt/bundle_visualization/pyproject.toml
# RUN uv sync --python 3.12
# ENV TMPDIR=/tmp
# ENV MRTRIX_TMPFILE_DIR=/tmp
# WORKDIR /data
# ENTRYPOINT ["/opt/pipeline/preprocessing.sh"]
# # Default: run full pipeline in the mounted working directory.
# CMD ["--inference", "."]