improved the quickstart docker guide

This commit is contained in:
ikeadeoyin
2022-10-10 08:48:43 +01:00
parent c126cc3f9b
commit b961925bbc

View File

@@ -1,49 +1,60 @@
Using Docker Install JupyterHub with Docker
============ ============================================
The JupyterHub `docker image <https://hub.docker.com/r/jupyterhub/jupyterhub/>`_ is the fastest way to set up Jupyterhub in your local development environment.
The ``JupyterHub`` docker image runs the Hub service only. It does not provide other Jupyter components such as Notebook installation, which are needed by the single-user servers.
To run the single-user servers, which may be on the same system as the Hub or not, Jupyter Notebook version 4 or greater must be installed.
.. important:: .. important::
We strongly recommend that you follow the `Zero to JupyterHub`_ tutorial to
install JupyterHub.
Prerequisites
-------------------------------
You should have `Docker Desktop`_ installed on a Linux/Unix based system.
We highly recommend following the `Zero to JupyterHub`_ tutorial for
installing JupyterHub.
Alternate installation using Docker Run the Docker Image
-----------------------------------
A ready to go `docker image <https://hub.docker.com/r/jupyterhub/jupyterhub/>`_
gives a straightforward deployment of JupyterHub.
.. note::
This ``jupyterhub/jupyterhub`` docker image is only an image for running
the Hub service itself. It does not provide the other Jupyter components,
such as Notebook installation, which are needed by the single-user servers.
To run the single-user servers, which may be on the same system as the Hub or
not, Jupyter Notebook version 4 or greater must be installed.
Starting JupyterHub with docker
------------------------------- -------------------------------
The JupyterHub docker image can be started with the following command:: To pull the latest JupyterHub image and start the `jupyterhub` container, run this command in your terminal::
docker run -d -p 8000:8000 --name jupyterhub jupyterhub/jupyterhub jupyterhub docker run -d -p 8000:8000 --name jupyterhub jupyterhub/jupyterhub jupyterhub
This command will create a container named ``jupyterhub`` that you can This command exposes the Jupyter container on port:8000. Navigate to `http://localhost:8000` in a web browser to access the JupyterHub console.
**stop and resume** with ``docker stop/start``.
The Hub service will be listening on all interfaces at port 8000, which makes You can stop and resume the container by running `docker stop` and `docker start` respectively.::
this a good choice for **testing JupyterHub on your desktop or laptop**.
If you want to run docker on a computer that has a public IP then you should # find the container id
(as in MUST) **secure it with ssl** by adding ssl options to your docker docker ps
# stop the running container
docker stop <container-id>
# resume the paused container
docker start <container-id>
If you are running Docker on a computer that has a public IP address, you must **secure it with ssl** by adding ssl options to your docker
configuration or using a ssl enabled proxy. configuration or using a ssl enabled proxy.
`Mounting volumes <https://docs.docker.com/engine/admin/volumes/volumes/>`_
will allow you to store data outside the docker image (host system) so it will
be persistent, even when you start a new image.
The command ``docker exec -it jupyterhub bash`` will spawn a root shell in your `Mounting volumes <https://docs.docker.com/engine/admin/volumes/volumes/>`_
docker container. You can use the root shell to **create system users in the container**. persist and stores the data generated by the docker container, even when you stop the container.
These accounts will be used for authentication in JupyterHub's default The persistent data can be stored outside the host system.
Create System Users
-------------------------------
Spawn a root shell in your docker container by running this command in the terminal.::
docker exec -it jupyterhub bash
The created accounts will be used for authentication in JupyterHub's default
configuration. configuration.
.. _Zero to JupyterHub: https://zero-to-jupyterhub.readthedocs.io/en/latest/ .. _Zero to JupyterHub: https://zero-to-jupyterhub.readthedocs.io/en/latest/
.. _Docker Desktop: https://www.docker.com/products/docker-desktop