-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
51 lines (40 loc) · 993 Bytes
/
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
# Run Docker container for Jupyter notebook
ARG STORMPY_BASE=movesrwth/stormpy:stable
FROM $STORMPY_BASE
MAINTAINER Matthias Volk <[email protected]>
##########
# Create user
##########
# Ubuntu 24.04 comes with 'ubuntu' user at id 1000
# Change it to 1001 to free up 1000 for the binder user
RUN usermod -u 1001 ubuntu
RUN groupmod -g 1001 ubuntu
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
# Change the owner of the virtual environment
WORKDIR /opt
USER root
RUN chown -R ${NB_UID} venv
USER ${NB_USER}
WORKDIR ${HOME}
# Add missing path
ENV PATH="$HOME/.local/bin:$PATH"
##########
# Install Jupyterlab
##########
RUN python3 -m pip install --no-cache-dir notebook jupyterlab
##########
# Copy files for notebooks
##########
COPY . ${HOME}
# Change owner of files
USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}