-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile_hub
115 lines (95 loc) · 5.31 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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
FROM jupyterhub/jupyterhub:5
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ARG http_proxy
ARG https_proxy
ARG no_proxy
ENV HTTP_PROXY=$HTTP_PROXY
ENV HTTPS_PROXY=$HTTPS_PROXY
ENV NO_PROXY=$NO_PROXY
ENV http_proxy=$HTTP_PROXY
ENV https_proxy=$HTTPS_PROXY
ENV no_proxy=$NO_PROXY
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_PRIORITY=critical
ARG CPU_ARCHITECTURE
ENV CPU_ARCHITECTURE=${CPU_ARCHITECTURE}
USER root
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y software-properties-common
# add extra repos
RUN apt-add-repository multiverse && \
apt-add-repository universe && \
add-apt-repository ppa:graphics-drivers/ppa && \
apt-get update && apt-get upgrade -y
# Add latest ubuntu repos to sources.list
# add arch
RUN if [ "${CPU_ARCHITECTURE}" = "amd64" ]; then \
echo "deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb http://archive.canonical.com/ubuntu/ jammy partner" | tee -a /etc/apt/sources.list ; \
echo "deb-src http://archive.canonical.com/ubuntu/ jammy partner" | tee -a /etc/apt/sources.list ; \
elif [ "${CPU_ARCHITECTURE}" = "arm64" ]; then \
echo "deb [arch=arm64] http://archive.canonical.com/ubuntu/ jammy partner" | tee -a /etc/apt/sources.list ; \
echo "deb-src [arch=arm64] http://archive.canonical.com/ubuntu/ jammy partner" | tee -a /etc/apt/sources.list ; \
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
echo "deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse" | tee -a /etc/apt/sources.list ; \
else \
echo "No valid CPU_ARCHITECTURE specified"; \
fi
RUN apt-get update && apt-get upgrade -y && \
apt-get --force-yes -o Dpkg::Options::="--force-confold" --force-yes -o Dpkg::Options::="--force-confdef" -fuy dist-upgrade && \
apt-get install -y \
gnupg \
libssl-dev \
wget \
curl \
gnupg \
gnupg-agent \
dirmngr \
ca-certificates \
apt-transport-https \
fonts-dejavu \
build-essential \
unixodbc \
unixodbc-dev \
gfortran \
gcc \
git \
ssh \
libgssapi-krb5-2 \
libkrb5-dev \
libsasl2-modules-gssapi-mit
RUN apt-get install --no-install-recommends -y python3 python3-pip python3-dev python3-all-dev ssl-cert
# clean up apt
RUN apt-get clean autoclean && apt-get autoremove --purge -y
######################################## Python / PIP SECTION ########################################
RUN pip3 install --no-cache-dir --upgrade pip
# utils for jupyterhub
RUN pip3 install --no-cache-dir setuptools wheel virtualenv cython isort netifaces
# jupyterhub stuff
RUN pip3 install --no-cache-dir detect simplejson ipywidgets importlib_metadata jupyterhub-firstuseauthenticator dockerspawner jupyterhub-nativeauthenticator
RUN pip3 install --no-cache-dir jupyterlab_widgets dask-labextension
RUN pip3 install --no-cache-dir jupyterhub-firstuseauthenticator jupyterhub-systemdspawner jupyterhub-jwtauthenticator jupyterhub-client jupyterhub-kerberosauthenticator --ignore-installed PyYAML
RUN pip3 install --no-cache-dir jupyterhub-ldapauthenticator jupyterhub-nanowireauthenticator jupyterhub-kubespawner jupyterhub-idle-culler
# RUN python3 -m jupyter contrib nbextension install --sys-prefix
# clean up pip
RUN pip3 cache purge
#######################################################################################################
RUN mkdir -p /home/jovyan/scratch
RUN chmod -R 777 /home/jovyan/scratch
RUN chmod g+s /home/jovyan/scratch
# copy scripts and config files
COPY config/jupyterhub_config.py /etc/jupyterhub/
USER $NB_UID