The nbdocker is an extension that allows for different Docker containers to be executed inside Jupyter notebooks. Each Docker container encapsulates its individual computing environment, thus allows different programming languages and computing environments to be included in one single notebook, provides the user to document the code as well as the computing environment.
Docker image: https://hub.docker.com/r/biodepot/nbdocker/
Pre-print: https://www.biorxiv.org/content/early/2018/05/02/309567
Authors: Jiaming Hu, Ling-Hong Hung, Ka Yee Yeung
Affiliation: School of Engineering and Technology, University of Washington Tacoma, WA, USA
Correspondence: [email protected]
A pre-installed Docker image was provided which contains Jupyter notebook and nbdocker as well.
docker pull biodepot/nbdocker
To run the nbdocker container:
docker run -it -p 8888:8888 -v /var/run/docker.sock:/var/run/docker.sock -v <your local path>:/home/jovyan/work --privileged --group-add root biodepot/nbdocker
You will then be given a URL. Copy/paste this URL into your browser and you can use nbdocker in your browser.
The installation instructions below are intended for developers who want to manually install the nbdocker for the purposes of development.
In order to run nbdocker on your local machine, you will need:
Python 3 >= 3.5.0
docker-py >= 3.0.0
If you don't have Jupyter Notebook installed, you can install it by running:
python3 -m pip install jupyter
git clone https://github.com/jmhoo/nbdocker.git
cd nbdocker
python3 -m pip install -e . --user
Note that there is a period (.) between -e and --user
Finally, install server extension and notebook extension for Jupyter:
jupyter serverextension enable --py --user nbdocker
jupyter nbextension install nbdocker --user
jupyter nbextension enable nbdocker/main --user
If you get an internal server error, you can try to run "sudo chmod 666 /var/run/docker.sock"
We would like to thank Dr. Wes Lloyd for helpful discussions in group meetings. We would like to thank Mr. Fang Chen for researching the different Jupyter magic commands and working on earlier implementations of the saving docker histories. L.H.H. and K.Y.Y. are supported by NIH grants U54HL127624 and R01GM126019. J.H. is supported by U54HL127624. We would also like to thank the Center for Data Science and the Institute of Technology at University of Washington Tacoma for the purchase of a computer server.
Bioinformatics Group University of Washington Tacoma