-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
141 lines (118 loc) · 4.17 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
133
134
135
136
137
138
139
140
141
# 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=quay.io/jupyter/datascience-notebook:hub-5.2.0
#ARG BASE_CONTAINER=032401129069.dkr.ecr.ca-central-1.amazonaws.com/jupyterhub:jupyterlab-all
FROM $BASE_CONTAINER
LABEL maintainer="Bala Rao <[email protected]>"
LABEL maintainer="Ryoko <[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 \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
# future version of base image will remove nodejs, uncomment below after upgrade
# npm \
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=10.4 python=3.11 && \
mamba install --yes -c conda-forge -c plotly \
"plotly" \
"jupyterlab-spellchecker" \
"dash" \
# installing xeus-cling will fail on arm64 platform
"xeus-cling" \
"openjdk" \
"maven" \
"ipython-sql" \
"jupyterlab-lsp" \
"jupyter-lsp-python" \
"jupyter_bokeh"
RUN R -e 'require(devtools); \
devtools::install_github("cardiomoon/ggiraphExtra"); \
install.packages("https://cran.r-project.org/src/contrib/Archive/lisp/lisp_0.1.tar.gz", repos = NULL, type = "source", quiet = TRUE); \
install.packages("https://cran.r-project.org/src/contrib/Archive/translate/translate_0.1.2.tar.gz", repos = NULL, type = "source", quiet = TRUE)'
# Install R packages
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' \
'r-car' && \
mamba clean --all -f -y
RUN pip install --upgrade setuptools
RUN pip install nbgitpuller \
pulp \
jupyter-resource-usage \
jupyterlab-code-formatter \
black \
pandas_ta \
ccxt \
# isort \
# jupyterlab-github \
jupyterlab-spreadsheet-editor \
jupyterlab_templates \
otter-grader \
vl-convert-python \
"vegafusion[embed]" \
"vegafusion-jupyter[embed]"
RUN pip install jupytext --upgrade
RUN npm cache clean --force && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/jovyan
RUN export NODE_OPTIONS=--max-old-space-size=4096
USER root
# Removed as the ijavascript has not been updated for more than 2 years
#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/
# install_scripts is deprecated
# RUN /opt/conda/envs/sage/bin/sage -c "install_scripts('/usr/local/bin')" && \
RUN 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 curl -fsSL https://deno.land/install.sh | bash -s -- -y && /home/jovyan/.deno/bin/deno jupyter --unstable --install
COPY widget_selection.py /opt/conda/lib/python3.11/site-packages/ipywidgets/widgets/
COPY interaction.py /opt/conda/lib/python3.11/site-packages/ipywidgets/widgets/
RUN chown -R jovyan:users /home/jovyan && \
chmod -R 0777 /home/jovyan && \
rm -rf /home/jovyan/*
USER jovyan
ENV HOME=/home/jovyan
WORKDIR $HOME