问题
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