Buildah Tutorial: Creating Containers Without Docker
Buildah is a Linux utility for building and managing containers compatible with OCI (Open Container Initiative). Unlike Docker, Buildah does not require a daemon, making it perfect for scripts and CI/CD pipelines.
Installing Buildah
On Ubuntu/Debian:
sudo apt update
sudo apt install -y buildah
RHEL/CentOS:
sudo yum install -y buildah
Key Commands
1. Create new container
buildah from ubuntu:24.04
This creates a new container based on the Ubuntu image and returns a unique container ID.
2. Run commands inside the container
buildah run <container-id> apt update
buildah run <container-id> apt install -y nginx
3.Copy files into the container
buildah copy <container-id> ./myapp /app
4. Commit container to an image
buildah commit <container-id> my-custom-image:latest
5. List images
buildah images
6. Run with Podman
Buildah creates OCI images, which you can run using Podman or Docker:
podman run -d -p 8080:80 my-custom-image:latest
Advantages of Buildah
- Daemonless — fewer overhead and security concerns.
- Full control over container build process.
- Ideal for CI/CD and automation scripts.
Conclusion
Buildah is an excellent Docker alternative for creating containers, especially if you prefer a lightweight, script-driven approach. Pair it with Podman for a complete container workflow.