Skip to content

Commit ef4ee20

Browse files
committed
Add Python 3.12
1 parent 9b5fdb2 commit ef4ee20

File tree

2 files changed

+83
-1
lines changed

2 files changed

+83
-1
lines changed

.github/workflows/build_python.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
username: ${{ github.repository_owner }}
3535
password: ${{ secrets.GITHUB_TOKEN }}
3636
-
37-
name: Build and push
37+
name: Build and push (Python 3.11)
3838
uses: docker/build-push-action@v5
3939
with:
4040
platforms:
@@ -46,3 +46,16 @@ jobs:
4646
dmri/ci-cd-py3.11:${{ env.SHORT_SHA }}
4747
ghcr.io/muscbridge/ci-cd-py3.11:latest
4848
ghcr.io/muscbridge/ci-cd-py3.11:${{ env.SHORT_SHA }}
49+
-
50+
name: Build and push (Python 3.12)
51+
uses: docker/build-push-action@v5
52+
with:
53+
platforms:
54+
linux/amd64
55+
file: Dockerfile_py3.12
56+
push: true
57+
tags: |
58+
dmri/ci-cd-py3.12:latest
59+
dmri/ci-cd-py3.12:${{ env.SHORT_SHA }}
60+
ghcr.io/muscbridge/ci-cd-py3.12:latest
61+
ghcr.io/muscbridge/ci-cd-py3.12:${{ env.SHORT_SHA }}

Dockerfile_py3.12

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
FROM python:3.12-bullseye
2+
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
3+
4+
# Set up configuration envvars
5+
ENV INSTALL_DIR=/usr/local \
6+
FSL_VERSION=6.0.7.9 \
7+
MRTRIX_VERSION=3.0.4 \
8+
VIRTUAL_ENV=/venv
9+
10+
# Initial update
11+
RUN apt update && \
12+
apt install -y \
13+
apt-utils \
14+
wget \
15+
curl \
16+
nano \
17+
software-properties-common \
18+
jq \
19+
libblas-dev \
20+
liblapack-dev \
21+
libatlas-base-dev \
22+
gfortran \
23+
git \
24+
g++ \
25+
clang \
26+
libeigen3-dev \
27+
zlib1g-dev \
28+
libqt5opengl5-dev \
29+
libqt5svg5-dev \
30+
libgl1-mesa-dev \
31+
libfftw3-dev \
32+
libtiff5-dev \
33+
libpng-dev
34+
35+
# Install Poetry
36+
ENV POETRY_HOME=${INSTALL_DIR}/poetry
37+
RUN curl -sSL https://install.python-poetry.org | python3 -
38+
ENV PATH=${PATH}:${POETRY_HOME}/bin
39+
40+
# Install UV
41+
RUN pip install uv && \
42+
uv venv ${VIRTUAL_ENV} && \
43+
uv pip install -U pip setuptools wheel
44+
ENV PATH=$PATH:${VIRTUAL_ENV}/bin
45+
46+
# Install FSL
47+
RUN curl https://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py -o /tmp/fslinstaller.py
48+
RUN echo "/usr/local/fsl" | python /tmp/fslinstaller.py -V ${FSL_VERSION}
49+
50+
# Configure FSL Environment
51+
ENV FSLDIR=${INSTALL_DIR}/fsl
52+
ENV FSLOUTPUTTYPE=NIFTI_GZ
53+
ENV PATH=$PATH:${FSLDIR}/bin
54+
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${FSLDIR}
55+
56+
# Build and configure MRTRIX3
57+
ENV MRTRIXDIR=${INSTALL_DIR}/mrtrix3
58+
RUN git clone --branch ${MRTRIX_VERSION} https://github.com/MRtrix3/mrtrix3.git ${MRTRIXDIR}
59+
ENV CXX=/usr/bin/clang++
60+
ENV ARCH=native
61+
RUN cd ${MRTRIXDIR} && \
62+
./configure -nogui -openmp && \
63+
./build
64+
ENV PATH=$PATH:${MRTRIXDIR}/bin
65+
66+
# Remove unwanted packages
67+
RUN apt autoremove && apt-get clean
68+
69+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)