How to handle python module installation when running jupyter notebook in docker?

偶尔善良 提交于 2019-12-10 21:08:19

问题


I'm currently starting to use the awesome jupyter notebook. Since I've always had troubles with stuff not working because of different python versions and python module versions, I like to run jupyter notebook in a docker container. I've created a Dockerfile to build my image (based on the official jupyter/scipy-notebook image on dockerhub), I have everything up and running and its working great.

The only thing that concerns me is how to handle the installation of different python modules I might need during the next week(s). How do you guys handle that?

1) Install the needed modules in the running docker container, then use docker commit and save the running container as a new image?

2) Always edit the Dockerfile to install the needed modules and re-build the image?

3) Don't delete the container (no --rm flag) and just restart it?

1) and 2) seem to be a little complicated, but I also want to be able to be able to start from a "fresh" notebook in case I mess something up, so 3) is also not perfect. Is there something I missed?

来源:https://stackoverflow.com/questions/47203010/how-to-handle-python-module-installation-when-running-jupyter-notebook-in-docker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!