-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
executable file
·114 lines (107 loc) · 3.54 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
105
106
107
108
109
110
111
112
113
114
# Usage:
# docker run --restart=on-failure:10 -d --name=jupyterhub -p 8000:8000 jupyterhub
# hadolint ignore=DL3007
FROM jupyterhub/jupyterhub:latest
LABEL maintainer="Mpho Mphego <[email protected]>"
# hadolint ignore=DL3008
RUN apt-get update -q && \
apt-get install -qq -y --no-install-recommends \
apg \
bash-completion \
build-essential \
curl \
g++ \
gcc \
git \
graphviz \
libstring-mkpasswd-perl \
locate \
make \
python3-dev \
software-properties-common \
unzip \
vim \
wget \
whois && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/apt/archives/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl https://bootstrap.pypa.io/get-pip.py | python3
ARG DL_TOOLS
RUN test -z "$DL_TOOLS" || python3 -m pip install -U \
# Current tensorflow release for CPU-only
tensorflow==2.0.0 \
tensorboard==2.0.0 \
# Current PyTorch release for CUDA
torch==1.2.0 \
torchvision==0.4.0 \
# Stable fast.ai release by default it installs latest PyTorch
fastai \
# Stable mxnet and gluoncv release https://gluon-cv.mxnet.io/install.html
mxnet \
gluoncv
RUN test -z "$DL_TOOLS" || python3 -m pip install -U --no-deps \
# Latest release of Detectron2: Object detection and segmentation. (Depends on Torch)
'git+https://github.com/facebookresearch/detectron2.git' \
'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
# Other dependencies
RUN python3 -m pip install -U \
black \
cython \
fvcore \
graphviz \
h5py \
handcalcs \
ipython['all'] \
ipywidgets \
jupyter \
matplotlib \
numpy \
pandas \
pandas_utility \
Pillow \
pydot \
pyyaml \
requests \
scikit-learn \
scipy \
seaborn \
sklearn \
tables \
termcolor \
tqdm \
watermark \
xgboost \
yacs \
xlrd
# Jupyter dependencies
RUN python3 -m pip install -U \
jupyter_contrib_nbextensions==0.5.1 \
jupyter_nbextensions_configurator==0.4.1 && \
jupyter contrib nbextension install --system --symlink && \
jupyter nbextensions_configurator enable --system && \
jupyter nbextension enable cell_filter/cell_filter --system && \
jupyter nbextension enable codefolding/edit --system && \
jupyter nbextension enable codefolding/main --system && \
jupyter nbextension enable collapsible_headings/main --system && \
jupyter nbextension enable exercise/main --system && \
jupyter nbextension enable exercise2/main --system && \
jupyter nbextension enable freeze/main --system && \
jupyter nbextension enable hide_header/main --system && \
jupyter nbextension enable highlighter/highlighter --system && \
jupyter nbextension enable rubberband/main --system && \
jupyter nbextension enable spellchecker/main --system && \
jupyter nbextension enable toc2/main --system && \
jupyter nbextension enable varInspector/main --system && \
jupyter nbextension install https://github.com/drillan/jupyter-black/archive/master.zip && \
jupyter nbextension enable jupyter-black-master/jupyter-black
# Setup user
RUN useradd jupyter -m -p "$(mkpasswd jupyter)" -s /bin/bash
EXPOSE 8000
WORKDIR /home/jupyter
RUN curl https://raw.githubusercontent.com/git/git/v2.25.0/contrib/completion/git-completion.bash -o \
/home/jupyter/.git-completion.bash && \
echo "source /home/jupyter/.git-completion.bash" >> /home/jupyter/.bashrc
RUN echo "source /etc/profile.d/bash_completion.sh" >> /home/jupyter/.bashrc
USER jupyter