podbag Blog

Releases, engineering notes, benchmarks and hands-on training from the people who build podbag.

podbag 0.1.0: containers with no daemon, stored file by file

by The podbag team · on in AnnouncementsPermalink

Today we release podbag 0.1.0, the first version of podbag.

podbag is a container engine. It runs your Docker and OCI images from one static binary. It has no daemon. It stores images file by file, not layer by layer.

Short on time? Watch the 30-second intro.

What podbag is

  • No daemon. When no container runs, nothing runs.
  • One static binary. About 4 MB on Linux.
  • Files, not layers. A file that many images share is stored once and cached once.
  • Fast. A container starts in about 4 ms on Linux.
  • Works with Docker tools. The docker CLI, Compose and buildx.
  • With or without root. The same program works both ways.
  • Linux, macOS and Windows. Windows support is experimental.

No daemon

Docker is a client and two daemons. dockerd and containerd run all the time, with or without containers. With no containers, they still hold 203 MiB.

podbag is one program:

  • The podbag command sets up each container itself, and then returns.
  • One small keeper per user (about 2 MiB) watches the running containers. It writes their logs, and answers stop, kill and wait.
  • The keeper starts with the first container. It stops 10 seconds after the last one.
  • With no container, nothing runs.

Files, not layers

Two images share most of their files. As layers, image B's top layer differs by one file, so its shared files are stored again: 8 files. podbag stores each file once: 6 files.
Layers against files: one changed file makes a layer store keep the whole layer again.

Other engines store an image as layers. A layer is kept once only when the whole layer is the same. When one file in it changes, the whole layer is stored again.

podbag splits each layer into files, and keeps each file once. An image is a list of paths to these files. When two containers read the same file, they read the same inode, so the kernel caches it once.

We measured 8 Spring services in 2 releases:

Data table
podbag902 MiB Docker2,970 MiB
podbag324 MiB Docker982 MiB
Data table
podbagDockerpodbag saves
Disk for both releases902 MiB2,970 MiB70%
Page cache to start their 16 services324 MiB982 MiB67%

Downloads stay the same size. Registries serve layers, and podbag downloads them whole before it splits them into files.

Start time and memory

How podbag compares with Docker, Podman and Kiri on one Linux VM: start time, memory for 100 containers, memory with no containers, disk and page cache.
podbag against Docker, Podman and Kiri, as an animation.

We ran every tool on the same Linux VM: 4 CPUs, 3.8 GiB, arm64. The versions: podbag 0.1.0, Podman 5.7.0, Docker 29.1.3 and Kiri 0.2.1. The numbers are medians. Lower is better.

Data table
podbag (rootless)4.1 ms podbag (root)4.4 ms Kiri9.1 ms Podman46.4 ms Docker73.8 ms
podbag (rootless)117 MiB podbag (root)105 MiB Kiri109 MiB Podman203 MiB Docker562 MiB
podbag (rootless)0 podbag (root)0 Kiri1 (5.9 MiB) Podman1 (0.6 MiB) Docker4 (203 MiB)
Data table
podbag (rootless)podbag (root)KiriPodmanDocker
Start a container4.1 ms4.4 ms9.1 ms46.4 ms73.8 ms
Memory for 100 containers117 MiB105 MiB109 MiB203 MiB562 MiB
Processes with no containers001 (5.9 MiB)1 (0.6 MiB)4 (203 MiB)
  • The first start, when no keeper runs yet, takes 12.8–16.0 ms.
  • Kiri is close on memory. podbag is ahead when no container runs, because then nothing of it runs.
  • All numbers, and how we measured them: benchmarks and the Spring microservices benchmark.
  • The same comparison as a video: perf.mp4.

Works with your Docker tools

podbag system service serves the Docker Engine API on a socket. The docker CLI, Compose and buildx talk to it.

Terminal
podbag system service &
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podbag/docker.sock
docker compose up -d
  • It is not a daemon. Containers do not depend on it.
  • It stops after 60 seconds without a client.
  • With systemd, it can start on the first connection.

With or without root

  • The same program works both ways.
  • As root, podbag mounts images with composefs.
  • Without root, it makes trees of hard links, and pasta connects the containers to the network.
  • podbag check lists what your system still needs, and how to add it.

Linux, macOS and Windows

  • Linux: x86_64 and arm64. Linux 5.12 or later, with cgroup v2.
  • macOS (Apple silicon): podbag runs a small Linux VM of its own. The first command starts it in about half a second. The VM powers off 60 seconds after the last container. Six minutes after the last container, podbag held 1.7 MiB of the Mac's memory.
  • Windows (x86_64 and arm64): experimental. podbag runs its Linux engine in a WSL 2 distribution of its own. It is built and tested in CI, but not yet tried on a Windows machine.

Install

On Linux and macOS:

Terminal
curl -fsSL https://podbag.dev/install.sh | sh

The script downloads the file for your system, checks its SHA-256 sum, and installs it in /usr/local/bin.

You can also get a file from the release page. Check it with SHA256SUMS.

SystemFile
Linux, x86_64podbag-x86_64-linux
Linux, arm64podbag-aarch64-linux
macOS, Apple siliconpodbag-aarch64-macos
Windows, x86_64 (experimental)podbag-x86_64-windows.exe
Windows, arm64 (experimental)podbag-aarch64-windows.exe

Then run your first container:

Terminal
podbag run --rm alpine echo hello

The limits of 0.1.0

This is a first release. Some things are not there yet:

  • Builds: Dockerfiles build only through buildx (docker buildx build). There is no classic builder.
  • Registries: podbag pulls public images. There are no logins, no private pulls and no push.
  • Docker commands: no commit, export, diff, stats, top, pause, rename or update.
  • Swarm: no swarm mode, and no plugins.
  • Kubernetes: there is no CRI, so a Kubernetes node cannot use podbag as its runtime.
  • Windows: experimental. The docker CLI on Windows cannot reach podbag yet.
  • Mac wake-up: the first command after the VM powered off takes about 0.6 s.

What comes next

Work on these is in open pull requests. It is not finished, and we give no dates:

  • registry logins, private pulls, push and search;
  • Dockerfile builds, and commit, export and diff;
  • a Kubernetes runtime, so a node can run its pods with podbag;
  • swarm mode on one node;
  • stats, top, pause, unpause, rename and update;
  • a terminal UI and a desktop app.

Try it and tell us

  • Read the usage guide for all commands.
  • Report bugs and ideas in GitHub issues. Reports from Windows machines help most.
  • podbag is open source, under the Apache License 2.0.