|
a |
|
b/Dockerfile |
|
|
1 |
FROM nvidia/cuda:11.1-base-ubuntu20.04 |
|
|
2 |
|
|
|
3 |
ENV DEBIAN_FRONTEND noninteractive |
|
|
4 |
|
|
|
5 |
RUN rm /etc/apt/sources.list.d/cuda.list |
|
|
6 |
RUN rm /etc/apt/sources.list.d/nvidia-ml.list |
|
|
7 |
RUN apt-key del 7fa2af80 |
|
|
8 |
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub |
|
|
9 |
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/7fa2af80.pub |
|
|
10 |
|
|
|
11 |
|
|
|
12 |
# Install some basic utilities |
|
|
13 |
# Install some basic utilities |
|
|
14 |
RUN apt-get update && apt-get install -y \ |
|
|
15 |
curl \ |
|
|
16 |
ca-certificates \ |
|
|
17 |
sudo \ |
|
|
18 |
gcc \ |
|
|
19 |
git \ |
|
|
20 |
bzip2 \ |
|
|
21 |
libx11-6 \ |
|
|
22 |
apt-utils \ |
|
|
23 |
unzip \ |
|
|
24 |
tar \ |
|
|
25 |
python3-opencv \ |
|
|
26 |
libsvm-dev \ |
|
|
27 |
build-essential \ |
|
|
28 |
&& rm -rf /var/lib/apt/lists/* |
|
|
29 |
|
|
|
30 |
# Create a working directory |
|
|
31 |
RUN mkdir /app |
|
|
32 |
WORKDIR /app |
|
|
33 |
|
|
|
34 |
# Create a non-root user and switch to it |
|
|
35 |
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \ |
|
|
36 |
&& chown -R user:user /app |
|
|
37 |
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user |
|
|
38 |
USER user |
|
|
39 |
|
|
|
40 |
# All users can use /home/user as their home directory |
|
|
41 |
ENV HOME=/home/user |
|
|
42 |
RUN chmod 777 /home/user |
|
|
43 |
|
|
|
44 |
# Install Miniconda and Python 3.8 |
|
|
45 |
ENV CONDA_AUTO_UPDATE_CONDA=false |
|
|
46 |
ENV PATH=/home/user/miniconda/bin:$PATH |
|
|
47 |
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh \ |
|
|
48 |
&& chmod +x ~/miniconda.sh \ |
|
|
49 |
&& ~/miniconda.sh -b -p ~/miniconda \ |
|
|
50 |
&& rm ~/miniconda.sh \ |
|
|
51 |
&& conda install -y python==3.8.1 \ |
|
|
52 |
&& conda clean -ya |
|
|
53 |
|
|
|
54 |
RUN conda create -n mne_pyt python=3.8 |
|
|
55 |
|
|
|
56 |
RUN echo "source activate mne_pyt" >> ~/.bashrc |
|
|
57 |
|
|
|
58 |
RUN /bin/bash -c "source ~/.bashrc" |
|
|
59 |
|
|
|
60 |
RUN pip install scipy |
|
|
61 |
|
|
|
62 |
RUN pip install numpy |
|
|
63 |
|
|
|
64 |
RUN pip install scikit-learn |
|
|
65 |
|
|
|
66 |
RUN pip install pandas |
|
|
67 |
|
|
|
68 |
RUN pip install jupyter |
|
|
69 |
|
|
|
70 |
RUN pip install h5py |
|
|
71 |
|
|
|
72 |
RUN pip install graphviz |
|
|
73 |
|
|
|
74 |
RUN pip install pydot |
|
|
75 |
|
|
|
76 |
RUN pip install keras |
|
|
77 |
|
|
|
78 |
RUN pip install matplotlib |
|
|
79 |
|
|
|
80 |
RUN pip install seaborn |
|
|
81 |
|
|
|
82 |
RUN pip install joblib |
|
|
83 |
|
|
|
84 |
RUN pip install -U mne |
|
|
85 |
|
|
|
86 |
RUN conda install pytorch==1.7.0 torchvision==0.8.0 cudatoolkit=11.0 -c pytorch |
|
|
87 |
|
|
|
88 |
RUN pip install torch-scatter==latest+cu110 -f https://pytorch-geometric.com/whl/torch-1.7.0.html |
|
|
89 |
RUN pip install torch-sparse==latest+cu110 -f https://pytorch-geometric.com/whl/torch-1.7.0.html |
|
|
90 |
RUN pip install torch-cluster==latest+cu110 -f https://pytorch-geometric.com/whl/torch-1.7.0.html |
|
|
91 |
RUN pip install torch-spline-conv==latest+cu110 -f https://pytorch-geometric.com/whl/torch-1.7.0.html |
|
|
92 |
RUN pip install torch-geometric==1.7.2 |
|
|
93 |
RUN pip install captum |
|
|
94 |
RUN pip install tensorboard |
|
|
95 |
|
|
|
96 |
RUN echo 'alias python="/home/user/miniconda/bin/python"' >> /home/user/.bashrc |
|
|
97 |
|
|
|
98 |
# set environment variables |
|
|
99 |
ENV NUMBA_CACHE_DIR=/tmp/numba_cache |
|
|
100 |
ENV MPLCONFIGDIR=/tmp/matplotlib_cache |
|
|
101 |
|
|
|
102 |
# What should we run when the container is launched |
|
|
103 |
ENTRYPOINT ["/bin/bash"] |
|
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|