Member-only story
How To Share Jupyter Notebooks With Docker
A quick walk-through example for sharing your Notebooks
As data scientists, we want our work to be reproducible, meaning that when we share our analysis everyone should be able to re-run it and come up with the same results. This is not always easy, since we are dealing with different operating systems (iOS, Windows, Linux) and different programming language versions and packages. That is why we encourage you to work with virtual environments like conda environments. Another more robust solution from conda environments is to work with Dockers.
Scenario: We have run an analysis using Python Jupyter Notebooks on our own data, and we want to share this analysis with various communities ensuring that everyone will be able to reproduce the results.
Run the Analysis Locally
For simplicity, let’s assume that I have run the following analysis:

In essence, I try to run a sentiment analysis on my_data.csv
using the pandas
, numpy
and vaderSentiment
libraries. Thus, I want to share this Jupyter Notebook, and I want it to be plug-and-play. Let's see how I can create a docker image containing a Jupyter Notebook, as well as my data and the required libraries.
Jupyter Docker Stacks
Jupyter Docker Stacks are a set of ready-to-run Docker images containing Jupyter applications and interactive computing tools. You can use a stack image to do any of the following (and more):
- Start a personal Jupyter Notebook server in a local Docker container
- Run JupyterLab servers for a team using JupyterHub
- Write your own project Dockerfile
We will build our custom image based on jupyter/scipy