Containerize Calibre To Serve Up Your Books Using Podman.

podman_banner

That’s a mouthful. Anyway, I got bored last night and since I haven’t messed with Docker and such I decided what the hell. Well, Docker looked like it wanted my to create an account and maybe buy things later so I decided to play with Podman instead. Took me about an hour to figure it all out. I found Podman Desktop and that helped with the fumbling. That was last night before bed…

Today at work a friend mentioned using Docker to serve up his books in Calibre. Sounded neat. I created an image and ran it. Worked great. Then I decided to script it so it creates a new Calibre library with books, creates the container, and copies the library over and fires it up so I can grab said books with a web browser. Luckily Calibre has command line ability!

The script creates a folder and saves the Dockerfile and creates a books folder. It then creates a Calibre library in the new books folder and adds books from a location you provide. I did not make that a runtime input so you will need to change it in the script. It then creates the container, installs Calibre, and copies the books over. It then runs the container. If you want an easy way to manage the image and run the container, get a copy of Podman Desktop. Once the script runs the image and container it created will display there, or mange it in the terminal.

Save this script as create-calibre.sh and run it in the terminal with: sh create-calibre.sh

You can also manually run the commands from this script if you prefer a more hands on deal. Also, if you are running this on anything other than Ubuntu/Debian derivatives you may want to change the apt commands to whatever your system uses, i.e., dnf, pacman, etc. between lines 47 to 56. You can install Podman manually and remove that section altogether if you prefer. Do not remove the dnf install for Calibre as that is running in the container and you need that.

Hope it’s useful in one way or another. Enjoy!

Plain Text