Running Jupyter Using Docker

The Jupyter Docker Stacks repository contains dockerfiles definitions, and the respective images are in Docker Hub.

Docs here.

Example:

docker run --rm -p 18888:8888 \
    -e JUPYTER_ENABLE_LAB=yes \
    -v "/Users/guaguito/jupyter-work":/home/jovyan/work \
    jupyter/tensorflow-notebook:7a0c7325e470

--rm: delete the container after it is used(stopped)

-p 18888:8888:map the port of container to port 18888 of the local computer

-e JUPYTER_ENABLE_LAB=yes: enable JupyterLab

-v "/Users/guaguito/jupyter-work":/home/jovyan/work: maps a directory in the container to a directory in the local computer (so that files are saved locally and not lost when the container is deleted). It is also possible to use for example -v "$PWD":/home/joyvan/work to specify the current directory

jupyter/tensorflow-notebook specifies the container image repository to use. 7a0c7325e470 is the tag identifying the image (if not specified docker will retrieve the one with the tag latest)

updatedupdated2024-09-032024-09-03