-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
78 lines (48 loc) · 2.55 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
# quay.io/jupyter/r-notebook:r-4.3.3 is one possible base image, you can find information about others here: https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html
# Check the Jupyter/docker-stacks repo for more information about other versions of Python/OS: https://github.com/jupyter/docker-stacks
FROM quay.io/jupyter/r-notebook:r-4.3.3 as base
LABEL maintainer=elisabettai
ENV JUPYTER_ENABLE_LAB="yes"
# autentication is disabled for now
ENV NOTEBOOK_TOKEN=""
ENV NOTEBOOK_BASE_DIR="$HOME/work"
USER root
ENV HOME="/home/$NB_USER"
# --------------- Add additional system libraries -------------------
# TODO: do you need additional system libraries (e.g. zip, bc, etc...)?
# If yes, uncomment the following and adapt
# If not, remove the following (or leave commented)
# RUN apt-get update && \
# apt-get install -y --no-install-recommends \
# bc \
# zip \
# && \
# apt-get clean && rm -rf /var/lib/apt/lists/*
# ------------------------- Other kernel -------------------------------------------
# This will install the additional packages that you specified in requirements.txt in the pre-existing R kernel
# Like in: https://github.com/jupyter/docker-stacks/blob/main/images/r-notebook/Dockerfile
ENV REQ_FILE="requirements.txt"
COPY --chown=$NB_UID:$NB_GID env-config/r/${REQ_FILE} ${NOTEBOOK_BASE_DIR}/${REQ_FILE}
RUN mamba install --yes --file ${NOTEBOOK_BASE_DIR}/${REQ_FILE}
## ------------------------------------------------------------------------
# ---------------- Final setup --------------------------------------------------------
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gosu \
&& \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Run a script from the base image to fix files permission
#RUN fix-permissions /home/$NB_USER
# copy README and CHANGELOG
COPY --chown=$NB_UID:$NB_GID README.ipynb ${NOTEBOOK_BASE_DIR}/README.ipynb
COPY --chown=$NB_UID:$NB_GID CHANGELOG.md ${NOTEBOOK_BASE_DIR}/CHANGELOG.md
# remove write permissions from files which are not supposed to be edited
RUN chmod gu-w ${NOTEBOOK_BASE_DIR}/CHANGELOG.md && \
chmod gu-w ${NOTEBOOK_BASE_DIR}/${REQ_FILE}
RUN mkdir --parents "/home/${NB_USER}/.virtual_documents" && \
chown --recursive "$NB_USER" "/home/${NB_USER}/.virtual_documents"
ENV JP_LSP_VIRTUAL_DIR="/home/${NB_USER}/.virtual_documents"
# Copying boot scripts
COPY --chown=$NB_UID:$NB_GID boot_scripts/ /docker
ENTRYPOINT [ "/bin/bash", "/docker/entrypoint.bash" ]