forked from ubc/jupyteropen-single-user-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
132 lines (109 loc) · 3.75 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# sudo docker kill $(sudo docker ps -q); sudo docker rm $(sudo docker ps -a -q); sudo docker rmi $(sudo docker images -q)
# sudo docker build --squash --no-cache -t 032401129069.dkr.ecr.ca-central-1.amazonaws.com/jupyterhub:jupyterlab-open .
ARG BASE_CONTAINER=jupyter/datascience-notebook:hub-3.1.0
FROM $BASE_CONTAINER
LABEL maintainer="Rahim Khoja <[email protected]>"
USER root
# Update System Packages for SageMath
RUN apt-get update && \
apt-get install -y --no-install-recommends \
dvipng \
ffmpeg \
imagemagick \
texlive \
tk tk-dev \
jq \
tzdata \
curl \
wget \
unzip \
zsh \
vim \
htop \
gfortran && \
ldconfig && \
apt-get autoclean && \
apt-get clean && \
apt-get autoremove
USER ${NB_UID}
# Install Conda Packages (Plotly, SageMath)
RUN mamba create --yes -n sage sage python=3.10 && \
mamba install --yes -c conda-forge -c plotly "sage" \
"jupyterlab-drawio" \
"plotly" \
"jupyterlab-spellchecker" \
"jupyter-dash" \
"xeus-cling" \
"openjdk" \
"maven" \
"ipython-sql" \
"jupyterlab-lsp" \
"jupyter-lsp-python" \
"jupyter_bokeh"
RUN R -e 'require(devtools); \
install_version("ggiraphExtra", repos = "http://cran.us.r-project.org", quiet = TRUE); \
install_version("lisp", version = "0.1", repos = "http://cran.us.r-project.org", quiet = TRUE); \
install_version("translate", version = "0.1.2", repos = "http://cran.us.r-project.org", quiet = TRUE)'
RUN mamba install --yes -c conda-forge \
'r-stargazer' \
'r-quanteda' \
'r-quanteda.textmodels' \
'r-quanteda.textplots' \
'r-quanteda.textstats' \
'r-caret' \
'r-ggiraph' \
'r-ggextra' \
'r-isocodes' \
'r-urltools' \
'r-ggthemes' \
'r-modelsummary' \
'r-nsyllable' \
'r-proxyc' \
'r-tidytext' && \
mamba clean --all -f -y
RUN pip install nbgitpuller \
jupyterlab-git \
jupyterlab-system-monitor \
lckr-jupyterlab-variableinspector \
jupyterlab_templates \
jupyterlab-code-formatter \
nbdime \
black \
pandas_ta \
ccxt \
isort \
jupyterlab_latex \
jupyterlab-github \
mitosheet3 && \
pip install jupytext --upgrade
RUN npm cache clean --force && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/jovyan
RUN jupyter labextension install jupyterlab-plotly && \
jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget && \
jupyter labextension install @techrah/text-shortcuts && \
jupyter labextension install jupyterlab-spreadsheet && \
jupyter labextension install jupyterlab_templates && \
jupyter serverextension enable --py jupyterlab_templates && \
jupyter serverextension enable nbgitpuller --sys-prefix && \
jupyter lab build
USER root
RUN npm install -g --unsafe-perm ijavascript && ijsinstall --hide-undefined --install=global
RUN npm install -g --unsafe-perm itypescript && its --ts-hide-undefined --install=global
# Install Java kernel
RUN wget -O /opt/ijava-kernel.zip https://github.com/SpencerPark/IJava/releases/download/v1.3.0/ijava-1.3.0.zip && \
unzip /opt/ijava-kernel.zip -d /opt/ijava-kernel && \
cd /opt/ijava-kernel && \
python install.py --sys-prefix && \
rm /opt/ijava-kernel.zip
ENV SAGE_ROOT=/opt/conda/envs/sage/
RUN /opt/conda/envs/sage/bin/sage -c "install_scripts('/usr/local/bin')" && \
ln -s "/opt/conda/envs/sage/bin/sage" /usr/bin/sage && \
ln -s /usr/bin/sage /usr/bin/sagemath
RUN jupyter kernelspec install $(/opt/conda/envs/sage/bin/sage -sh -c 'ls -d /opt/conda/envs/sage/share/jupyter/kernels/sagemath'); exit 0
RUN chown -R jovyan:users /home/jovyan && \
chmod -R 0777 /home/jovyan && \
rm -rf /home/jovyan/*
USER jovyan
ENV HOME=/home/jovyan
WORKDIR $HOME