Using Podman, Compose and BuildKit
3 days ago
- #Podman
- #Docker-Compose
- #BuildKit
- Using Podman for Docker Compose projects due to Docker's incompatibility with nftables and preference for rootless + daemonless approach.
- Podman offers two solutions for Docker Compose: connecting Docker Compose CLI to Podman socket or using Podman's drop-in replacement, podman-compose.
- Official Docker Compose CLI with Podman uses classic builder instead of BuildKit, missing features like additional contexts.
- podman-compose lacks features such as !reset, configs, and referencing another service in additional contexts.
- Solution found to use Docker Compose CLI under Podman with BuildKit enabled by creating a new Docker context for Podman.
- BuildKit can be managed manually with systemd, avoiding the default automagical container creation.
- Compose projects can be converted to JSON Bake files for building without BuildKit, using tools like Bakah for translation to Podman/Buildah commands.
- Bakah simplifies building complex Compose projects by translating Bake files to Buildah commands, though it lacks some advanced Bake features.
- Future plans include using Bakah for soju-containers to split Dockerfiles and replace CI shell scripts with Podman CLI invocations.