gdsbook/book

Running the notebook on Podman

rnanclares opened this issue · 1 comments

For people interested in running the notebooks with Podman (Fedora, RHEL, Almalinux, etc). You can run the notebooks without any issue with the following commands:

# These two first commands allow the container user to write into a directory in your system, usually in the /home/user/ path
podman unshare chown -R 1000:100 ./book/data/
podman unshare chown -R 1000:100 ./book/notebooks/
# actually the directory that needs to be owned by the user inside the container is ./book/notebooks/cache but it doesn't exist until you run the 03_spatial_data notebook the first time).
# To download the image from Docker hub and run the container use the next command
podman run --privileged --name book -it --rm -p 8888:8888 -v ./book/:/home/jovyan/work darribas/gds:7.0

Why do we need to do this? Some of the code in the notebooks creates outputs in local directories and Podman has more security restrictions than Docker, and it usually doesn't needs to be run with sudo or as root. If you don't want to change the permissions on your system you can run the container using sudo.

Hope this is helpful to anybody trying to follow the book using podman.

Cheers.

Thank you very much @rnanclares!!! Will leave the issue open until we can see how we can include this on the website/blog to give it more visibility, I think it's very useful!