-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
99 lines (85 loc) · 3.41 KB
/
Dockerfile
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
94
95
96
97
98
99
# Use Ubuntu 20.04
FROM ubuntu:focal-20210921
# Prepare environment
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
bzip2 \
ca-certificates \
xvfb \
build-essential \
autoconf \
libtool \
pkg-config \
graphviz \
git && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y --no-install-recommends \
nodejs && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install latest pandoc
RUN curl -o pandoc-2.2.2.1-1-amd64.deb -sSL "https://github.com/jgm/pandoc/releases/download/2.2.2.1/pandoc-2.2.2.1-1-amd64.deb" && \
dpkg -i pandoc-2.2.2.1-1-amd64.deb && \
rm pandoc-2.2.2.1-1-amd64.deb
# Installing and setting up miniconda
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh && \
bash Miniconda3-py38_4.10.3-Linux-x86_64.sh -b -p /usr/local/miniconda && \
rm Miniconda3-py38_4.10.3-Linux-x86_64.sh
# Set CPATH for packages relying on compiled libs (e.g. indexed_gzip)
ENV PATH="/usr/local/miniconda/bin:$PATH" \
CPATH="/usr/local/miniconda/include/:$CPATH" \
LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
PYTHONNOUSERSITE=1
# Installing precomputed python packages
RUN conda install -y python=3.8.5 \
pip=20.2.4 \
mkl=2018.0.3 \
mkl-service \
numpy=1.15.4 \
scipy=1.1.0 \
scikit-learn=0.19.1 \
pandas=0.23.4 \
libxml2=2.9.8 \
libxslt=1.1.32 \
graphviz=2.40.1 \
traits=4.6.0 \
sphinx>=3.2.1 \
multiprocess \
zlib; sync && \
chmod -R a+rX /usr/local/miniconda; sync && \
chmod +x /usr/local/miniconda/bin/*; sync && \
conda build purge-all; sync && \
conda clean -tipsy && sync
RUN pip install nibabel dipy nilearn fury weasyprint nipype
# Unless otherwise specified each process should only use one thread - nipype
# will handle parallelization
ENV MKL_NUM_THREADS=1 \
OMP_NUM_THREADS=1
# Create a shared $HOME directory
RUN useradd -m -s /bin/bash -G users difit
WORKDIR /home/difit
ENV HOME="/home/difit"
# # Precaching fonts, set 'Agg' as default backend for matplotlib
# RUN python -c "from matplotlib import font_manager" && \
# sed -i 's/\(backend *: \).*$/\1Agg/g' $( python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
# Installing difit
COPY . /src/difit
ARG VERSION
RUN pip install --no-cache-dir "/src/difit[all]"
RUN find $HOME -type d -exec chmod go=u {} + && \
find $HOME -type f -exec chmod go=u {} + && \
rm -rf $HOME/.npm $HOME/.conda $HOME/.empty
RUN ldconfig
WORKDIR /tmp/
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="difit" \
org.label-schema.description="difit - An MRI diffution model fitting software" \
org.label-schema.url="http://difit.readthedocs.org" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/kodiweera/difit" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0.0"