--- slug: bookworm-and-podman title: "Bookworm and Podman" date: "2023-05-02T01:27:00-04:00" --- I've spent the last couple days fiddling with [Debian Bookworm RC2][bookworm] in a VM. No issues to report. It's shaping up to be a great release. I've been looking for a suitable [Docker][] replacement for a few years because of [their repeated license shenanigans][license-shenanigans]. Last year I tried switching to [Podman][], but ran into into several incompatibilities and minor annoyances. [Podman 4.3][podman-4.3] ships with [Bookworm][] and seems to fix all the issues I had before. [Rootless containers][], [multi-stage builds][multi-stage], and all of my muscle-memory `docker` commands now work as expected. There is even a decent clone of [docker-compose][] named (surprise!) [podman-compose][]. The only real differences I noticed are: 1. The command is `podman` instead of `docker`. 2. Image names must be registry-prefixed. Example: `FROM docker.io/bash` instead of `FROM bash`. 3. Searches must be registry-prefixed. Example: `podman search docker.io/pablotron`. A couple of quick tests: * [Sinatra web application (rootless)][sinatra-test] * [Go web application (rootless, scratch, multi-stage build)][go-test] **Update (2023-05-05):** I put together a [simple web application named Bookman][bookman] to put [podman-compose][] through it's paces. It uses multiple containers, [multi-stage builds][multi-stage], boot dependencies, secrets, and volumes. [Here's a log of the setup process][bookman-gist], and [here's a screenshot][bookman-shot] of the exposed web interface. **Update (2023-05-13):** I upgraded several VMs from [Bullseye][] (and one from [Stretch][]!?!) to [Bookworm][], without any significant issues. After upgrading to [Bookworm][], I migrated two VMs from [Docker][] to [Podman][] and installed [Podman][] on a third VM. Useful tip: [Rootless][rootless containers] [Podman][] does not agree with an [NFS][]-mounted home directory. One workaround is to create a local (that is, non-[NFS][]), user-owned directory and then symlink `~/.local/share/containers` to it, like so: ```bash # create local containers directory for user pabs, # then symlink ~pabs/.local/share/containers to it. sudo mkdir -pm 700 /data/containers/pabs && \ sudo chown pabs:pabs /data/containers/pabs && \ ln -s /data/containers/pabs ~pabs/.local/share/containers ``` Alternatively, the [Podman man page][] suggests configuring `~/.config/containers/storage.conf` and pointing `graphroot` at a local directory. [bookworm]: https://www.debian.org/releases/bookworm/ "Debian bookworm." [bullseye]: https://www.debian.org/releases/bullseye/ "Debian bullseye." [stretch]: https://www.debian.org/releases/stretch/ "Debian stretch." [debian]: https://debian.org/ "Debian Linux." [docker]: https://www.docker.com/ "Docker container manager." [podman]: https://podman.io/ "Podman container manager." [podman-4.3]: https://github.com/containers/podman/releases/tag/v4.3.0 "Podman version 4.3." [rootless containers]: https://developers.redhat.com/blog/2020/09/25/rootless-containers-with-podman-the-basics "Rootless containers." [multi-stage]: https://docs.docker.com/build/building/multi-stage/ "Multi-stage build." [sinatra-test]: https://gist.github.com/pablotron/86cb0b355ac3e4cef3b28b3e0718314d "Test Sinatra web application running in a Podman container." [go-test]: https://gist.github.com/pablotron/03785b66cc9e90ebd5fdaef5642baa6d "Test Go web application running in a Podman container." [license-shenanigans]: https://blog.alexellis.io/docker-is-deleting-open-source-images/ "Docker is deleting Open Source organizations (updated)." [podman-compose]: https://github.com/containers/podman-compose "Podman-compatible clone of Docker Compose." [docker-compose]: https://docs.docker.com/compose/ "Tool for defining and running multi-container Docker applications." [bookman]: https://github.com/pablotron/bookman "Bookman GitHub repository." [bookman-gist]: https://gist.github.com/pablotron/f19037d1718224611efd7aa6e05f82b6 "Annotated log of commands to start Bookman with podman-compose." [bookman-shot]: /files/posts/bookworm-and-podman/bookman.png "Bookman web interface deployed via podman-compose." [nfs]: https://en.wikipedia.org/wiki/Network_File_System "Network File System" [podman man page]: https://docs.podman.io/en/latest/markdown/podman.1.html "HTML-formatted man page for podman command."