I'm setting up a Jupyter server using the scipy-notebook image from quay.io and need to add a few extra Python libraries. Right now, I manually install the libraries using apt and pip every time I spin up the container with a `docker run` command. Is there a more efficient way to do this? Should I create a Dockerfile based on the scipy-notebook image to include these packages? Any tips on how to do this properly?
1 Answer
You should definitely create your own Dockerfile that starts with the `FROM` directive pointing to the Jupyter image. After that, you can add your libraries with `RUN apt install` if they're Ubuntu packages or copy them from your host filesystem if they are binaries or scripts. You might also want to look into using Docker Compose to simplify the setup, especially with the build option that references your Dockerfile! Here's an example of how to use `RUN`: https://docs.docker.com/reference/dockerfile/#run. Advanced methods can be found in the Docker Compose documentation too: https://docs.docker.com/reference/compose-file/build/
Thanks! I'll start working through those suggestions.