-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
81 lines (66 loc) · 2.6 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
# Run with the RenkuKubeSpawner via JupyterHub
ARG BASE_IMAGE=jupyter/base-notebook:aec555e49be6
FROM $BASE_IMAGE as base
LABEL maintainer="Swiss Data Science Center <[email protected]>"
USER root
# Install additional dependencies and nice-to-have packages
RUN apt-get update && apt-get install -yq --no-install-recommends \
build-essential \
curl && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get update && apt-get install -yq --no-install-recommends \
git \
git-lfs=2.12.0 \
gnupg \
graphviz \
less \
libsm6 \
libxext-dev \
libxrender1 \
libyaml-0-2 \
libyaml-dev \
lmodern \
musl-dev \
nano \
netcat \
python-dev \
unzip \
vim && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
# Add a new group with id 1000 and arbitrary name
# Note: this is to standardize groups between the R and jupyter images
RUN groupadd -g 1000 jovyan
# switch to the notebook user
USER $NB_USER
# install jupyterlab, papermill, git extension and renku-jupyterlab-ts
COPY requirements.txt /tmp/requirements.txt
RUN python3 -m pip install --no-cache -U pip && \
python3 -m pip install --no-cache -r /tmp/requirements.txt && \
jupyter labextension install --no-build @jupyterlab/toc && \
jupyter labextension install --no-build jupyterlab-topbar-extension jupyterlab-system-monitor && \
jupyter lab build && \
jupyter labextension list && \
npm cache clean --force && \
rm -rf /home/${NB_USER}/.cache
# fix https://github.com/SwissDataScienceCenter/renku-jupyter/issues/14
RUN conda install gxx_linux-64 && \
# jupyter sets channel priority to strict which often causes very long error messages
conda config --system --set channel_priority flexible && \
conda clean --all -f -y
# install renku-python
ENV RENKU_DISABLE_VERSION_CHECK 1
ENV PATH=$HOME/.local/bin:$PATH
RUN pipx install --pip-args="--no-cache" renku && \
pipx inject --pip-args="--no-cache" renku sentry-sdk
# configure git
COPY git-config.bashrc /home/$NB_USER/
RUN cat /home/$NB_USER/git-config.bashrc >> /home/$NB_USER/.bashrc && rm /home/$NB_USER/git-config.bashrc
# configure powerline
COPY --chown=1000:1000 powerline.bashrc /tmp/powerline.bashrc
COPY --chown=1000:1000 powerline.config /home/${NB_USER}/.config/powerline-shell/config.json
RUN cat /tmp/powerline.bashrc >> ~/.bashrc && rm /tmp/powerline.bashrc
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "tini", "--", "/entrypoint.sh" ]
CMD '/usr/local/bin/start-singleuser.sh'