-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
96 lines (83 loc) · 2.18 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
FROM nvidia/cuda:11.7.0-cudnn8-devel-ubuntu18.04
LABEL maintainer="Edgar Y. Walker <edgar.walker@gmail.com>"
# Deal with pesky Python 3 encoding issue
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV MPLLOCALFREETYPE 1
RUN apt-get update && apt-get install -y software-properties-common
# Add Python ppa
RUN add-apt-repository ppa:deadsnakes/ppa
# Install essential Ubuntu packages
# and upgrade pip
RUN apt-get update && apt-get install -y \
build-essential \
git \
wget \
vim \
curl \
zip \
zlib1g-dev \
unzip \
pkg-config \
libgl-dev \
libblas-dev \
liblapack-dev \
python3-tk \
python3-wheel \
graphviz \
libhdf5-dev \
python3.9 \
python3.9-dev \
python3.9-distutils \
swig \
apt-transport-https \
lsb-release \
libpng-dev \
ca-certificates &&\
# obtain latest of nodejs
curl -sL https://deb.nodesource.com/setup_12.x | bash - &&\
apt install -y nodejs &&\
apt-get clean &&\
ln -s /usr/bin/python3.9 /usr/local/bin/python &&\
ln -s /usr/bin/python3.9 /usr/local/bin/python3 &&\
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py &&\
python3 get-pip.py &&\
rm get-pip.py &&\
# best practice to keep the Docker image lean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /src
# Install essential Python packages
RUN python3 -m pip --no-cache-dir install \
blackcellmagic\
pytest \
pytest-cov \
numpy \
matplotlib \
scipy \
pandas \
jupyter \
scikit-learn \
scikit-image \
seaborn \
graphviz \
gpustat \
h5py \
gitpython \
ptvsd \
Pillow==6.1.0 \
opencv-python
RUN python3 -m pip --no-cache-dir install \
torch==1.13.1 \
torchvision==0.14.1 \
torchaudio==0.13.1 \
'jupyterlab>=2'
RUN python3 -m pip --no-cache-dir install datajoint==0.12.9
# Add profiling library support
ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:${LD_LIBRARY_PATH}
# Export port for Jupyter Notebook
EXPOSE 8888
# Add Jupyter Notebook config
ADD ./jupyter_lab_config.py /root/.jupyter/
WORKDIR /notebooks
# By default start running jupyter notebook
ENTRYPOINT ["jupyter", "lab", "--allow-root"]