Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Containerizing Jupyter Notebooks

This example demonstrates how to generate a container for a Jupyter notebook.

The script outputs a container specification file that can be built into a container image. Use --help to list all the script command line options.

The example includes a very simple Jupyter notebook, Conda environment (environment.yml), and requirements.txt for illustrative purposes.


Using pip:

$ --notebook --requirements requirements.txt > Dockerfile

Using Anaconda:

$ --packager anaconda --notebook --environment environment.yml > Dockerfile

Once the Dockerfile has been generated, the steps to build and run the container are the same.

$ sudo docker build -t jupyter:example -f Dockerfile .
$ sudo docker run --rm -p 8888:8888 jupyter:example


Using pip:

$ --notebook --requirements requirements.txt --format singularity > Singularity.def

Using Anaconda:

$ --packager anaconda --notebook --environment.yml --format singularity > Singularity.def

Once the Singularity definition file has been generated the steps to build and run the container are the same.

$ sudo singularity build jupyter-example.sif Singularity.def
$ singularity run jupyter-example.sif
You can’t perform that action at this time.