buildah(1)
Build OCI container images using rootless or root commands without requiring a daemon.
Synopsis
buildah COMMAND [OPTIONS] [ARG...]Description
Buildah is a tool for building Open Container Initiative (OCI) compliant container images. It allows you to build images from Dockerfiles or using a series of buildah commands, and works without requiring a Docker daemon running in the background.
Buildah can run rootless (as a regular user) on systems with proper user namespace support, making it safer for automated and multi-tenant environments. Images built with buildah are fully compatible with Docker, Podman, and other OCI-compliant container runtimes.
Common options
| Flag | What it does |
|---|---|
--help | Show help information for the command or subcommand |
--version | Display buildah version information |
-f, --file | Path to Dockerfile (used with bud command) |
-t, --tag | Name and optionally a tag for the built image |
--build-arg | Set build-time variables (passed to FROM base image) |
--layers | Cache intermediate layers during build (default true) |
--quiet | Suppress output of successful commands |
--isolation | Type of isolation (oci, chroot, rootless) for the build environment |
--format | Image format (docker, oci) for output image |
--pull | Pull base image even if cached locally |
Examples
Build an image from a Dockerfile in the current directory, tagging it as myapp:latest
buildah bud -f Dockerfile -t myapp:latest .Create a new build container based on the alpine:latest image
buildah from alpine:latestRun a command inside an existing build container to install packages
buildah run mycontainer apk add --no-cache nginxCopy files from the host into a build container
buildah copy mycontainer /local/app /appSet the entrypoint for a build container
buildah config --entrypoint '["nginx"]' mycontainerCommit a build container to create a new image
buildah commit mycontainer myimage:v1.0Build an image passing build arguments that can be used in Dockerfile
buildah bud --build-arg VERSION=1.0 -t app:1.0 .List all images available to buildah
buildah images