How podman-container-tools/buildah works
Buildah is a daemonless tool and Go API for constructing OCI or Docker-format container images. A typical user workflow starts from a base image or scratch, applies Containerfile/Dockerfile instructions or direct container operations, configures the result, then commits it as an image. The README also documents image transfer and local container/image management. The sampled sources show command initialization, build execution, filesystem copying, and Linux isolation; other command relationships below rely on README descriptions, not inspection of their implementations.
Main entry points: from.go Container commands · main.go CLI dispatcher · pull.go Image commands · stage_executor.go Build stage executor
Components 16
Command interface
- CLI dispatcher
cmd/buildah/main.go - Build command
cmd/buildah/build.go - Container commands
cmd/buildah/from.go - Image commands
cmd/buildah/pull.go
Image construction
- Build API
define/build.go - Build stage executor
imagebuildah/stage_executor.go - Filesystem copier
copier/copier.go
Container runtime
- Container filesystem
internal/volumes/volumes.go - Linux isolation
chroot/run_linux.go - Bind mounts
bind/mount.go
Image lifecycle
- Commit image
commit.go - Image transfer
push.go - Image operations API
image.go - Local image storage
Other components
- Buildah user
- Image registry
Connections 17
- Buildah user → CLI dispatcher: invokes
- CLI dispatcher → Build command: initializes
cmd/buildah/main.go - CLI dispatcher → Container commands: initializes
cmd/buildah/main.go - CLI dispatcher → Image commands: initializes
- Build command → Build stage executor: executes build
- Build stage executor → Filesystem copier: copies files
imagebuildah/stage_executor.go - Build stage executor → Build API: uses options
imagebuildah/stage_executor.go - Buildah user → Container commands: creates container
- Container commands → Container filesystem: manipulates filesystem
- Container commands → Linux isolation: runs command
- Container commands → Bind mounts: mounts filesystem
- Buildah user → Commit image: commits container
- Buildah user → Image commands: pulls or pushes
- Image commands → Image registry: transfers image
- Image commands → Local image storage: reads or writes
- Commit image → Local image storage: stores image
- Buildah user → Image operations API: uses Go API