Skip to content

Instantly share code, notes, and snippets.

@kingand
Last active March 2, 2019 23:16
Show Gist options
  • Save kingand/bbb32603d3154e67bc5115a6a1af5ef0 to your computer and use it in GitHub Desktop.
Save kingand/bbb32603d3154e67bc5115a6a1af5ef0 to your computer and use it in GitHub Desktop.
Run Jupyter Notebook in a Docker container

Jupyter Notebooks with Docker

Purpose

This gist explains how to run the Jupyter Notebooks server and Python kernel within a Docker container instead of installing it locally.

Instructions

Run the following command where <local_notebooks_dir> is the directory where you store your Jupyter Notebooks on your local machine. This directory will be exposed within the Jypter Notebooks web client.

docker run -p 8888:8888 -v <local_notebooks_dir>:/home/jovyan jupyter/minimal-notebook

To access the Jupyter Notebooks client, follow the instructions printed out to the terminal window once the container starts.

There is a great tutorial on using Jupyter Notebooks here: https://www.dataquest.io/blog/jupyter-notebook-tutorial/

For more details about the container, review the Dockerfile: https://github.com/jupyter/docker-stacks/blob/master/minimal-notebook/Dockerfile

References

  1. https://www.dataquest.io/blog/docker-data-science/
  2. https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html
  3. https://hub.docker.com/u/jupyter
  4. https://www.dataquest.io/blog/jupyter-notebook-tutorial/
  5. https://github.com/jupyter/docker-stacks/blob/master/minimal-notebook/Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment