mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-17 06:52:56 +00:00
Fill-in and refine instructions to run
This commit is contained in:
@@ -15,27 +15,12 @@ Jupyter Docker Stacks are a set of ready-to-run Docker images containing Jupyter
|
||||
Quick Start
|
||||
-----------
|
||||
|
||||
The examples below may help you get started if you have Docker installed, know which Docker image you want to use, and want to launch a single Jupyter Notebook server in a container. The other pages in this documentation describe additional uses and features in detail.::
|
||||
The two examples below may help you get started if you `have Docker installed <https://docs.docker.com/install/>`_, know :doc:`which Docker image <using>` you want to use, and want to launch a single Jupyter Notebook server in a container. The other pages in this documentation describe additional uses and features in detail.
|
||||
|
||||
# Run a Jupyter Notebook server in a Docker container started
|
||||
# from the jupyter/scipy-notebook image built from Git commit 2c80cf3537ca.
|
||||
# All files saved in the container are lost when the notebook server exits.
|
||||
# -ti: pseudo-TTY+STDIN open, so the logs appear in the terminal
|
||||
# -rm: remove the container on exit
|
||||
# -p: publish the notebook port 8888 as port 8888 on the host
|
||||
docker run -ti --rm -p 8888:8888 jupyter/scipy-notebook:2c80cf3537ca
|
||||
**Example 1:** This command pulls the `jupyter/scipy-notebook` image tagged `2c80cf3537ca` from Docker Hub if it is not already present on the local host. It then starts a container running a Jupyter Notebook server and exposes the server on host port 8888. The server logs appear in the terminal and include a URL to the notebook server. The container remains intact for restart after notebook server exit.::
|
||||
|
||||
# Run a Jupyter Notebook server in a Docker container started from the
|
||||
# jupyter/r-notebook image built from Git commit e5c5a7d3e52d.
|
||||
# All files written to ~/work in the container are saved to the
|
||||
# current working on the host and persist even when the notebook server
|
||||
# exits.
|
||||
docker run -ti --rm -p 8888:8888 -v "$PWD":/home/jovyan/work jupyter/r-notebook:e5c5a7d3e52d
|
||||
docker run -p 8888:8888 jupyter/scipy-notebook:2c80cf3537ca
|
||||
|
||||
# Run a Jupyter Notebook server in a background Docker container started
|
||||
# from the latest jupyter/all-spark-notebook image available on the local
|
||||
# machine or Docker Cloud. All files saved in the container are lost
|
||||
# when the container is destroyed.
|
||||
# -d: detach, run container in background.
|
||||
# -P: Publish all exposed ports to random ports
|
||||
docker run -d -P jupyter/all-spark-notebook:latest
|
||||
**Example 2:** This command pulls the `jupyter/r-notebook` image tagged `e5c5a7d3e52d` from Docker Hub if it is not already present on the local host. It then starts an *ephemeral* container running a Jupyter Notebook server and exposes the server on host port 10000. The command mounts the current working directory on the host as `/home/jovyan/work` in the container. The container is destroyed after notebook server exit, but any files written to `~/work` in the container remain intact on the host.::
|
||||
|
||||
docker run --rm -p 10000:8888 -v "$PWD":/home/jovyan/work jupyter/r-notebook:e5c5a7d3e52d
|
||||
|
@@ -5,7 +5,7 @@ Using one of the Jupyter Docker Stacks requires two choices:
|
||||
1. Which Docker image you wish to use
|
||||
2. How you wish to start Docker containers from that image
|
||||
|
||||
This section provides details about the available images and runtimes to inform your choices.
|
||||
This section provides details about the available images and runtimes.
|
||||
|
||||
## Selecting an Image
|
||||
|
||||
@@ -140,16 +140,67 @@ You must refer to git-SHA image tags when stability and reproducibility are impo
|
||||
|
||||
The core stacks are just a tiny sample of what's possible when combining Jupyter with other technologies. We encourage members of the Jupyter community to create their own stacks based on the core images and link them below.
|
||||
|
||||
*Nothing here yet!*
|
||||
*Nothing here yet! You can be the first!*
|
||||
|
||||
See the [contributing guide](contributing#Community-Stacks) for information about how to create your own Jupyter Docker Stack.
|
||||
|
||||
## Running a Container
|
||||
|
||||
### Using the Docker CLI
|
||||
|
||||
You can launch a local Docker container from the Jupyter Docker Stacks using the [Docker command line interface](https://docs.docker.com/engine/reference/commandline/cli/). There are numerous ways to configure containers using the CLI. The following are a few common patterns.
|
||||
|
||||
```
|
||||
docker run -p 8888:8888 jupyter/scipy-notebook:2c80cf3537ca
|
||||
```
|
||||
|
||||
This command pulls the `jupyter/scipy-notebook` image tagged `2c80cf3537ca` from Docker Hub if it is not already present on the local host. It then starts a container running a Jupyter Notebook server and exposes the server on host port 8888. The server logs appear in the terminal and include a URL to the notebook server.
|
||||
|
||||
```
|
||||
Executing the command: jupyter notebook
|
||||
[I 15:33:00.567 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
|
||||
[W 15:33:01.084 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
|
||||
[I 15:33:01.150 NotebookApp] JupyterLab alpha preview extension loaded from /opt/conda/lib/python3.6/site-packages/jupyterlab
|
||||
[I 15:33:01.150 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
|
||||
[I 15:33:01.155 NotebookApp] Serving notebooks from local directory: /home/jovyan
|
||||
[I 15:33:01.156 NotebookApp] 0 active kernels
|
||||
[I 15:33:01.156 NotebookApp] The Jupyter Notebook is running at:
|
||||
[I 15:33:01.157 NotebookApp] http://[all ip addresses on your system]:8888/?token=112bb073331f1460b73768c76dffb2f87ac1d4ca7870d46a
|
||||
[I 15:33:01.157 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
|
||||
[C 15:33:01.160 NotebookApp]
|
||||
|
||||
Copy/paste this URL into your browser when you connect for the first time,
|
||||
to login with a token:
|
||||
http://localhost:8888/?token=112bb073331f1460b73768c76dffb2f87ac1d4ca7870d46a
|
||||
```
|
||||
|
||||
Pressing `Ctrl-C` shuts down the notebook server but leaves the container intact on disk for later restart or permanent deletion using commands like the following:
|
||||
|
||||
```
|
||||
docker ps -a
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
d67fe77f1a84 jupyter/base-notebook "tini -- start-noteb…" 44 seconds ago Exited (0) 39 seconds ago cocky_mirzakhani
|
||||
|
||||
docker start -a d67fe77f1a84
|
||||
Executing the command: jupyter notebook
|
||||
[W 16:45:02.020 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
|
||||
...
|
||||
|
||||
|
||||
### Using the Docker Command Line
|
||||
docker rm -a d67fe77f1a84
|
||||
d67fe77f1a84
|
||||
```
|
||||
|
||||
TODO: ephemeral container with host mount
|
||||
|
||||
### Using Binder
|
||||
|
||||
[Binder](https://mybinder.org/) is a service that allows you to create and share custom computing environments for projects in version control. You can use any of the Jupyter Docker Stack images as a basis for a Binder-compatible Dockerfile. See the [docker-stacks example](https://mybinder.readthedocs.io/en/latest/sample_repos.html#using-a-docker-image-from-the-jupyter-docker-stacks-repository) and [Using a Dockerfile](https://mybinder.readthedocs.io/en/latest/dockerfile.html) sections in the [Binder documentation](https://mybinder.readthedocs.io/en/latest/index.html) for instructions.
|
||||
|
||||
### Using JupyterHub
|
||||
|
||||
### Using Binder
|
||||
You can configure JupyterHub to launcher Docker containers from the Jupyter Docker Stacks images. If you've been following the [Zero to JupyterHub with Kubernetes](http://zero-to-jupyterhub.readthedocs.io/en/latest/) guide, see the [Use an existing Docker image](http://zero-to-jupyterhub.readthedocs.io/en/latest/user-environment.html#use-an-existing-docker-image) section for details. If you have a custom JupyterHub deployment, see the [Picking or building a Docker image](https://github.com/jupyterhub/dockerspawner#picking-or-building-a-docker-image) instructions for the [dockerspawner](https://github.com/jupyterhub/dockerspawner) instead.
|
||||
|
||||
### Using Other Tools and Services
|
||||
|
||||
You can use the Jupyter Docker Stacks with any Docker-compatible technology (e.g., [Docker Compose](https://docs.docker.com/compose/), [docker-py](https://github.com/docker/docker-py), your favorite cloud container service). See the documentation of the tool, library, or service for details about how to reference, configure, and launch containers from these images.
|
Reference in New Issue
Block a user