Skip to content
LatchkeyLatchkey home

buildah bud: Build Images From a Dockerfile

buildah bud builds an OCI image from a Containerfile or Dockerfile without a Docker daemon, the same job docker build does but rootless-friendly.

buildah is the daemonless builder behind podman build. buildah bud (build-using-dockerfile) takes a Dockerfile and produces an image, running rootless in CI.

What it does

buildah bud reads a Containerfile/Dockerfile and executes its instructions to build an OCI image, tagging it with -t. It runs without a central daemon and supports rootless builds, so it suits unprivileged CI. buildah build is the same command.

Common usage

Terminal
# build and tag
buildah bud -t ghcr.io/acme/app:1.4.0 -f Dockerfile .

# pass build args
buildah bud -t app:local \
  --build-arg VERSION=1.4.0 --build-arg COMMIT="$GITHUB_SHA" .

# build a specific platform
buildah bud --platform linux/arm64 -t app:arm64 .

Options

FlagWhat it does
-t, --tag <ref>Name and tag for the built image
-f, --file <path>Path to the Containerfile/Dockerfile
--build-arg key=valueSet a build argument
--platform os/archTarget platform for the build
--layersCache intermediate layers between builds
--format oci|dockerOutput image format

In CI

buildah bud builds Dockerfiles rootless in a plain container, no daemon and no --privileged in many setups. Follow it with buildah push to publish. Enable --layers so unchanged steps are cached across pipeline runs.

Common errors in CI

"error creating build container ... potentially insufficient UIDs or GIDs available in user namespace" is the classic rootless buildah error; fix /etc/subuid and /etc/subgid for the runner user. "no such file or directory" for the Dockerfile means -f is wrong. "error building at STEP" prints the failing instruction, exactly like docker build.

Frequently asked questions

buildah bud: Build Images From a Dockerfile?
buildah is the daemonless builder behind podman build. buildah bud (build-using-dockerfile) takes a Dockerfile and produces an image, running rootless in CI.
What it does?
buildah bud reads a Containerfile/Dockerfile and executes its instructions to build an OCI image, tagging it with -t. It runs without a central daemon and supports rootless builds, so it suits unprivileged CI. buildah build is the same command.
In CI?
buildah bud builds Dockerfiles rootless in a plain container, no daemon and no --privileged in many setups. Follow it with buildah push to publish. Enable --layers so unchanged steps are cached across pipeline runs.
Common errors in CI?
"error creating build container ... potentially insufficient UIDs or GIDs available in user namespace" is the classic rootless buildah error; fix /etc/subuid and /etc/subgid for the runner user. "no such file or directory" for the Dockerfile means -f is wrong.

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card