Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
88 lines (76 loc) · 2.34 KB
/
Copy pathDockerfile
File metadata and controls
88 lines (76 loc) · 2.34 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
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
FROM ghcr.io/astral-sh/uv:0.13.1 AS uv
# Keep /opt/jupyter/bin off PATH to separate server Python from shell Python.
FROM ubuntu:26.04@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7 AS jupyter
COPY --from=uv /uv /uvx /usr/local/bin/
ENV UV_PYTHON_INSTALL_DIR=/opt/uv \
UV_PROJECT_ENVIRONMENT=/opt/jupyter \
UV_PYTHON_DOWNLOADS=manual \
UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_NO_CACHE=1
RUN uv python install 3.14
WORKDIR /src
COPY extension/pyproject.toml extension/uv.lock extension/.python-version ./
RUN uv sync --frozen --no-dev --no-editable --no-install-project
COPY extension/ ./
# Install non-editably so runtime does not depend on this stage's source tree;
# the extension config installs under /opt/jupyter/etc/jupyter for startup.
RUN uv sync --frozen --no-dev --no-editable
FROM ubuntu:26.04@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7
RUN sed -i '\|path-exclude=/usr/share/man/\*|d' /etc/dpkg/dpkg.cfg.d/excludes \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
bash-completion \
build-essential \
file \
git \
htop \
jq \
less \
libarchive-tools \
lsof \
man-db \
manpages \
manpages-dev \
nano \
ncdu \
procps \
psmisc \
python3 \
rsync \
strace \
tmux \
tree \
unzip \
vim \
zip \
&& apt-get install --reinstall -y --no-install-recommends \
bash \
coreutils \
findutils \
grep \
mawk \
sed \
tar \
&& rm -f /usr/bin/man \
&& dpkg-divert --quiet --remove --rename /usr/bin/man \
&& rm -rf /var/lib/apt/lists/*
COPY --from=jupyter /opt/uv /opt/uv
COPY --from=jupyter /opt/jupyter /opt/jupyter
COPY jupyter_server_config.py /opt/jupyter/etc/jupyter/jupyter_server_config.py
# Spawner overrides these defaults; they keep the image runnable on its own.
# Runtime and data use /tmp because the root filesystem is read-only and /tmp is
# a tmpfs.
ENV EDITOR=nano \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
TERM=xterm-256color \
HOME=/home/ubuntu \
TMPDIR=/home/ubuntu/.tmp \
LAB_MAX_TERMINALS=4 \
JUPYTER_CONFIG_PATH=/opt/jupyter/etc/jupyter \
JUPYTER_RUNTIME_DIR=/tmp/jupyter/runtime \
JUPYTER_DATA_DIR=/tmp/jupyter/data
USER ubuntu
WORKDIR /home/ubuntu
CMD ["/opt/jupyter/bin/jupyterhub-singleuser"]