-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·104 lines (86 loc) · 3.81 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
100
101
102
103
104
# ** Taken from fMRIPREP **
# Use Ubuntu 16.04 LTS
FROM ubuntu:xenial-20161213
# Pre-cache neurodebian key
COPY docker_files/neurodebian.gpg /root/.neurodebian.gpg
# Prepare environment
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
bzip2 \
ca-certificates \
xvfb \
cython3 \
build-essential \
autoconf \
libtool \
pkg-config \
git=1:2.7.4-0ubuntu1 \
graphviz=2.38.0-12ubuntu2 && \
curl -sSL http://neuro.debian.net/lists/xenial.us-ca.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \
apt-key add /root/.neurodebian.gpg && \
(apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true) && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
# Installing Neurodebian packages (FSL, AFNI, git)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
nodejs \
fsl-core=5.0.9-5~nd16.04+1 \
fsl-mni152-templates=5.0.7-2 \
afni=16.2.07~dfsg.1-5~nd16.04+1 \
convert3d && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV FSLDIR=/usr/share/fsl/5.0 \
FSLOUTPUTTYPE=NIFTI_GZ \
FSLMULTIFILEQUIT=TRUE \
LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \
POSSUMDIR=/usr/share/fsl/5.0 \
FSLTCLSH=/usr/bin/tclsh \
FSLWISH=/usr/bin/wish \
AFNI_MODELPATH=/usr/lib/afni/models \
AFNI_IMSAVE_WARNINGS=NO \
AFNI_TTATLAS_DATASET=/usr/share/afni/atlases \
AFNI_PLUGINPATH=/usr/lib/afni/plugins
ENV PATH=/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH
# Installing miniconda --if problems occur, look here for dependency issues
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b -p /usr/local/miniconda && \
rm Miniconda3-latest-Linux-x86_64.sh
ENV PATH=/usr/local/miniconda/bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
PYTHONNOUSERSITE=1
# Installing precomputed python packages --if problems occur, look here first for dependency issues
ADD docker_files/conda_requirements.txt conda_requirements.txt
RUN conda install -y -c conda-forge --file conda_requirements.txt; sync && \
conda build purge-all && sync
# 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())" )
# Unless otherwise specified each process should only use one thread - nipype
# will handle parallelization
ENV MKL_NUM_THREADS=1 \
OMP_NUM_THREADS=1
# Installing dev requirements (packages that are not in pypi) -- if problems occur, look here for dependency issues
WORKDIR /home
ADD docker_files/pip_requirements.txt pip_requirements.txt
RUN pip install -r pip_requirements.txt && \
rm -rf ~/.cache/pip
# add jupyterlab extensions -- Don't currently work
#RUN jupyter labextension install jupyterlab-flake8
#RUN jupyter labextension install @jupyterlab/toc
# install updated nilearn
RUN pip install git+https://github.com/nilearn/nilearn@e0573ede3ff2f155a2ff21a65d8047a7395d63fd
# Set up data and script directories, ENV variables
Run mkdir /scripts
WORKDIR /scripts
ENV SHELL=/bin/bash
# Expose Jupyter port & cmd
EXPOSE 8888
RUN mkdir -p /opt/app/data
CMD jupyter lab --ip=0.0.0.0 --port=8888 --no-browser \
--notebook-dir=/opt/app/data --allow-root \
--notebook-dir="/" \
--NotebookApp.token='' \
--NotebookApp.password=''