-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.hub
39 lines (33 loc) · 1.44 KB
/
Dockerfile.hub
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
# Docker build instructions for the custom Nublado JupyterHub build.
#
# This Dockerfile only has a single stage because rather than using the
# virtualenv trick for dependencies like our other Docker builds, it
# installs the additional Python modules directly into the local paths
# used by system Python. This is done since changing the execution
# environment of JupyterHub from the base container seems fragile and
# likely to break.
#
# The drawback is that the image is much larger than it would need to be,
# since it contains build-time dependencies that would only normally be
# necessary while installing extra Python modules.
# This is just an alias to avoid repeating the base image.
FROM jupyterhub/jupyterhub:5.0.0
# Update and install packages.
COPY hub/scripts/install-packages.sh .
RUN ./install-packages.sh && rm install-packages.sh
# Install the dependencies of the extra JupyterHub modules.
COPY hub/requirements/main.txt ./requirements.txt
RUN pip install --quiet --no-cache-dir -r requirements.txt
# Install the extra JupyterHub modules.
COPY . /workdir
WORKDIR /workdir
RUN pip install --no-deps --no-cache-dir ./authenticator ./spawner
# Create a non-root user to run JupyterHub. Upstream uses 768 as the UID
# and GID. This value must be kept in sync with the Phalanx nublado
# application values.yaml.
RUN groupadd --gid 768 jovyan
RUN useradd --create-home jovyan --uid 768 --gid 768
WORKDIR /home/jovyan
USER jovyan
EXPOSE 8000
EXPOSE 8081