-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile.run
46 lines (45 loc) · 1.95 KB
/
Dockerfile.run
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
# Instal and run JupyterHub on Debian Stretch
# ===========================================
#
# ./build.sh debian:stretch
# docker build --tag jupyterhub-stretch -f Dockerfile.run build
# docker run --rm -it -p 8000:8000 -p 8001:8001 jupyterhub-stretch
#
# To copy examples and open Jupyter (do this in another terminal):
#
# ( builtin cd docs/examples/ >/dev/null && tar -c *.ipynb ) | docker exec -i $(docker ps | grep jupyterhub-stretch | cut -f1 -d' ') bash -c "cd /home/admin && tar -xv"
# xdg-open "http://127.0.0.1:8000/user/admin/tree"
#
# The password for the `admin` account is `test1234`.
#
# To enter the container:
#
# docker exec -it $(docker ps | grep jupyterhub-stretch | cut -f1 -d' ') bash
#
FROM debian:stretch
ENV LANG=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive
RUN env LANG=C apt-get update -qq \
&& env LANG=C apt-get install -yqq --no-install-recommends \
sudo locales ca-certificates curl perl gnupg2 apt-utils apt-transport-https \
python3-tk libyaml-0-2 \
&& echo "$LANG UTF-8" >/etc/locale.gen \
&& locale-gen --lang "$LANG" \
&& echo 'deb [trusted=yes] https://deb.nodesource.com/node_8.x stretch main' \
>/etc/apt/sources.list.d/nodesource.list \
&& ( curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key \
| env APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=true apt-key add - ) \
&& apt-get update -qq \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf "/var/lib/apt/lists"/*
WORKDIR /srv/jupyterhub
COPY *.deb ./
RUN echo JUPYTERHUB_AUTO_RESTART=false >/etc/default/jupyterhub \
&& dpkg -i --force-confold jupyterhub_[0-9]*~stretch_amd64.deb \
&& groupadd jhub \
&& useradd -g jhub -G jhub,users -c "JupyterHub Admin" -s /bin/bash --create-home admin \
&& chmod 750 ~admin \
&& chown -R admin.jhub ~admin \
&& ( echo 'admin:test1234' | chpasswd )
EXPOSE 8000
EXPOSE 8001
ENTRYPOINT su -s /bin/sh -c /usr/sbin/jupyterhub-launcher jupyterhub