Blasting pods into orbit
Find out how to get your first full application up and running.
We’ve established that Podman is a superb and useful tool, and demonstrated an example deployment. But hunting around on GitHub for self-hosted web apps is a chore, and a rabbit hole in which you can lose yourself for days on end. Do they have container images ready to download and deploy or don’t they? It can be a pain finding out.
There are thousands of apps, services, games and more that have been lovingly packaged and stuffed into containers, ready to ship, and Podman has a tool that can help you search them all.
You will recall that on the previous page you had to specify that Podman
was to download the PiGallery2 image from docker.io. It’s a minor inconvenience that exists only because Podman doesn’t come readyconfigured to search container registries for images. Fortunately for you, it’s an easy fix, and involves using Nano (other text editors are available) to edit a single configuration file:
$ sudo nano /etc/containers/registries.conf
In here, you’ll find dozens of lines of commented-out text. While you can ignore this if you want, it’s useful information, intended to guide you in setting up container registries for Podman and Docker. There are details on spoofing, on how improperly setting up entries can lead to malware attacks, and about the correct formatting.
We assume you’ll read and digest the entire text as a priority. For now, though, add the following line at the bottom of the file:
unqualified-search-registries = [“registry.fedoraproject. org”, “registry.access.redhat.com”, “quay.io”, “docker. io”, “registry.redhat.io”, “docker.io”]
Save and exit Nano with Ctrl+O then Ctrl+X. Each of these registry entries contain from dozens to thousands of images – although most of the ones you’re pulling are from quay.io and docker.io. If you feel your fingers tiring before you finish typing, feel free to only add these two.
To search what’s available, use the Podman search command. If you have a sudden and desperate need to archive huge sections of the internet using a selfhosted app with a nifty web interface, you would enter:
$ podman search archivebox
You’ll see dozens of results, with images for the
ArchiveBox front-end, back-end, API and more. The description field should give you an idea of which one you want. In our case it’s the docker.io/archivebox/ archivebox image. It’s one of only three that have a description, and is titled ‘Official Docker image for the
ArchiveBox self-hosted...’
Once you’ve found the image you want, you’re likely to be confused and angry. There are no accompanying instructions, nothing on whether you need to mount volumes, and very little other information. You won’t even find the homepage of the project. It’s a bit of a letdown, and one that will send you back to your browser.
While it’s tempting to hit up GitHub again, not all projects are hosted there, so use your favourite search engine to search for the project instructions.
Podman is the new kid on the block, and few developers are, as yet, aware of its existence. You’ll see instructions for installing the binary directly, using Python, Homebrew or even as an Electron app, but it’s unlikely you’ll find instructions to install using Podman. Instead, look for the Docker instructions and simply
swap out every instance of the word ‘docker’ with ‘podman’ instead.
To install ArchiveBox with Podman, create a directory for it and move into it:
$ mkdir ~/archivebox && cd ~/archivebox
The following command mounts a data volume within your current directory, downloads the ArchiveBox image, and launches setup. It uses -it
(Interactive and TTY) to take you straight inside the container. We’ve also tailored the command to specify the image we located using the Podman search command earlier:
$ podman run -v $PWD:/data -it docker.io/archivebox/
archiveboxinit --setup
If you didn’t modify the command beyond swapping ‘podman’ for ‘docker’, you’re asked to choose an image and registry in the next step.
Hit Enter, and Podman begins pulling down blobs. This can take some time, so occupy yourself by leafing through this month’s exemplary HotPicks (see page 83)
while you wait…
ArchiveBox initialises with an SQLite database to keep track of your saved web pages, and the setup wizard guides you through the rest of the installation process. You need to create an admin user for the web UI, and then ArchiveBox creates a few more directories in which to store your scraped media.
When you’re returned to the command prompt, start the ArchiveBox server and web UI with:
$ podman run -v $PWD:/data -p 8000:8000
archivebox/archivebox
You can now open your browser and navigate to localhost:8000.
The ArchiveBox interface is utilitarian, and looks like it stepped through a time portal from Web 1.0. Don’t despair, because it’s a powerful and useful tool that can help you keep an accurate record of what parts of the web looked like at a particular instant in time. The Internet Archive may eventually succumb to legal challenges and horrendous cost overheads, but your very own archive will continue for as long as you have a solid 3-2-1 backup regime.
Log into your ArchiveBox instance using the button in the top-right of the screen and the admin credentials you created earlier.
You no doubt have a list of sites you want to archive for posterity, so click on the Add button, and enter the site URLs one at a time. You also need to choose whether to archive only the URLs themselves or the URLs plus pages one hop away.
Lastly, select the archive method you want to use. There are plenty of options here including screenshot, PDF, headers, title, media, readability and Wget. Hold Shift to select multiple options, or if you prefer to download everything, leave the options blank.
We chose to archive the LinuxFormat.com homepage, plus the details pages for the previous 11 issues. We also wanted screenshots and PDFs.
When you’re ready, hit the big yellow button, and sit back. Choosing to drill down one layer gave us a total of 90 saved pages in two different formats. If we’d selected to scrape media as well, it would have pulled all images, videos and embedded audio files on those pages, too. Storage is cheap, but it is finite, and with
ArchiveBox it can fill up fast.
ArchiveBox is just one example of the many projects you can run safely using Podman. If you’re the type of person who values their privacy and wants to live like a normal person without having tech giants and surveillance companies watching over their shoulder, it’s possible to replace essential services with self-hosted Podman alternatives.
Instead of Google Photos, for example, try the excellent Immich instead. And you can use Podman to install and run a self-hosted Nextcloud
instance instead of using Dropbox or either Microsoft or Google Drive.
Doubtless you have an extensive audio and video collection, as well. Jellyfin – covered in depth in LXF308 – can help you manage it and stream to every device you own. And with Podman,
it’s easy, quick and safe to install, too.
CONTAINER SHIPPING “Thousands of apps, services, games and more have been stuffed into containers, ready to ship, and Podman has a tool to help you search them all.”