-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (43 loc) · 1.83 KB
/
Copy pathDockerfile
File metadata and controls
53 lines (43 loc) · 1.83 KB
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
# Start with a custom image with pre-installed tools:
FROM ghcr.io/digipres/toolbox:master
# Add a browser for desktop sessions:
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get install -y firefox-esr && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Add the Jupyter things we need
RUN pip install --no-cache-dir jupyterlab notebook pandas altair requests warcio
# Switch off announcements pop-up
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
# Do required setup for running on Binder...
# https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html
ARG NB_USER=jovyan
ARG NB_UID=1000
ARG USERNAME=$NB_USER
ARG USER_UID=$NB_UID
ARG USER_GID=$USER_UID
# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m -s /bin/bash $USERNAME \
#
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
# Set the working directory
ARG HOME=/home/${NB_USER}
WORKDIR ${HOME}
# Make sure the contents of our repo are in ${HOME}
COPY welcome.ipynb README.md ./
COPY rclone.conf .config/rclone/rclone.conf
ADD notebooks notebooks
ADD test-files test-files
# Set up the workspace so the startup looks consistent
COPY default.jupyterlab-workspace workspace.json
RUN jupyter lab workspaces import workspace.json && rm workspace.json
# Also install the lc-shell files in case anyone wants them:
RUN curl -O -L https://librarycarpentry.org/lc-shell/data/shell-lesson.zip && \
unzip shell-lesson.zip -d shell-lesson -x '__MACOSX/*' && \
rm shell-lesson.zip
# Switch to the run-time user
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}