-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
67 lines (57 loc) · 1.95 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
ARG JH_VERSION=1.4.2
FROM jupyterhub/jupyterhub:${JH_VERSION}
ARG JH_VERSION
ENV JH_VERSION=${JH_VERSION}
# Install dependencies
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
openssh-client vim && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install -U --no-cache-dir \
pip && \
rm -rf /root/.cache/pip/*
# Jupyterhub & co
# PyJWT is for oauthenticator
RUN python3 -m pip install --no-cache-dir \
# TODO: Is this actually required? Most jupyter stuff should come from
# upstream
jupyter \
# Used by cull_idle_servers and hub_status_service
python-dateutil \
pytz \
# For loading course YAMLs in GET_COURSES()
pyyaml \
# https://oauthenticator.readthedocs.io/en/latest/reference/changelog.html
'oauthenticator<7' \
# Used by oauthenticator
PyJWT \
# Fix CVE-2023-37920
'certifi>=2023.7.22' \
&& \
rm -rf /root/.cache/pip/*
# kubespawner
# Listing jupyterhub here separately to prevent it from being unintentionally
# upgraded as a dependency
# https://jupyterhub-kubespawner.readthedocs.io/en/latest/changelog.html
RUN python3 -m pip install \
jupyterhub-kubespawner==4.3.0 \
jupyterhub==${JH_VERSION} \
&& \
rm -rf /root/.cache/pip/*
# Enable aalto domain join
RUN apt-get update && \
apt-get install -y --no-install-recommends \
adcli sssd sssd-krb5 krb5-config sssd-ldap sssd-ad libpam-sss && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --chmod=644 secrets/krb5.conf /etc/krb5.conf
# Ubuntu 22.04 has broken default flags for sssd
RUN sed -i 's/DAEMON_OPTS="-D -f"/DAEMON_OPTS="-D --logger=files"/' /etc/default/sssd
COPY secrets/join_ad.sh /usr/local/bin/join_ad.sh
RUN chmod +x /usr/local/bin/join_ad.sh
COPY scripts/run.sh /run.sh
RUN chmod +x /run.sh
RUN mkdir /courses
CMD ["bash", "-c", "/run.sh"]