Buildah: Build Container Images Without a Docker Daemon, Rootless (Linux, Windows, Mac)
Before you start
- 24 min read
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
Buildah is a free, open-source command-line tool that builds container images as your normal user, with no Docker daemon running, either from a Dockerfile or from a plain shell script.

Logo: the official Buildah project (github.com/podman-container-tools/buildah, file logos/buildah-logo_large_transparent-bg.png, Apache-2.0)
Buildah builds images without a root Docker daemon or socket. Each command exits when done.
| What | Value (official sources, read 5 December 2026) |
|---|---|
| Current version | Buildah v1.46.1, released 11 November 2026 (GitHub releases; previous v1.46.0, 21 October 2026) |
| Repository | podman-container-tools/buildah. It moved from containers/buildah; the old address answers with a redirect (HTTP 301) |
| Licence | Apache-2.0 (LICENSE at the release tag) |
| Container image | quay.io/buildah/stable:v1.46.1 (tag checked on Quay). For CI we pin an older one, see "Which version" |
| Time needed | About 60 minutes for all five steps (our estimate) |
| RAM and size | No official figure, none measured |
| Ports | None. Buildah has no server and no web page |
| Official docs | buildah.io and the man pages in the repository |
At a glance:
- What it is: a command-line builder for OCI images (the open standard behind Docker images). No daemon.
- Two ways to build:
buildah buildreads a Dockerfile; or you scriptfrom,run,copy,configandcommit. - Rootless: it works as a normal user, through user namespaces (your user acts as root inside the build only).
- CI: run it as a plain user on a build machine, so no job needs
docker.sock. - Platforms: Buildah is for Linux. On Windows and Mac use Podman, which builds with Buildah's code.
- Not covered: running containers (Podman guide) and copying images (Skopeo guide).
Which version. We target v1.46.1 on Linux; distribution packages may be older (Ubuntu 24.04: 1.33.7; Ubuntu 26.04: 1.42.1; Fedora 45: 1.46.1). Container CI stays on v1.43.5-immutable: after Quay's 1.43-to-1.45 jump, users reported overlay-build failures (issue 6910, open 5 December 2026).
How it fits together#
Buildah reads your Dockerfile or script, pulls the base image from a registry, writes the layers into storage in your home folder, and pushes the finished image to your registry. A CI job can start the same command.
Drawn for this guide from the official docs. The dashed box is optional.
Words: a Containerfile is a Dockerfile (Buildah reads both names). A layer is one saved build step. A working container is a temporary container Buildah makes while building; you do not run it.
Before you start#
Note: every domain, user name and password on this page is a dummy example (
registry.example.com,change-me). Replace them with your own and keep real secrets out of Git.
| System | What to have |
|---|---|
| Linux | A normal user (not root), sudo once for the install |
| Windows | PowerShell. No Windows build of Buildah: use Podman (podman build) or WSL 2 with Ubuntu |
| Mac | No Mac build of Buildah: use Podman, and a Linux machine for scripts |
| Registry | One you can push to. Our Docker Registry guide sets one up |
git --version curl --version
Checklist:
- [ ] A registry address and account, or the dummy ones from this page
- [ ] A free range in
/etc/subuidand/etc/subgidfor your user (Step 1 checks it) - [ ] For Step 5: a separate Linux build machine or VM, not your main server
Tested by DIY Lab Hub: not yet. Every command comes from the official man pages and docs at v1.46.1, read on 5 December 2026. We did not run Buildah on a real machine, so we show no real output; where we show output, it is the shape from the official docs.
LLM Guide: let your AI assistant set it up#
We can use an AI assistant to follow this guide. Copy the block below into ChatGPT, Claude, Gemini or a local model. It first asks about your setup, then follows only the path that fits you.
Set up rootless Buildah and build the guide's tiny nginx image without a Docker daemon.
Follow https://diylabhub.com/buildah/ (checked 5 December 2026).
Work one step at a time. Explain each command first. Wait for my OK before deleting data, stopping services, changing my router or opening ports.
STEP 0 - FIND OUT MY SETUP:
1. Which system: Linux distribution, Windows or Mac? On Linux run buildah --version and check grep "^$USER:" /etc/subuid /etc/subgid. On Windows/Mac, is Podman installed?
2. Am I building from a Dockerfile or a Buildah shell script? Scripts need Linux, including WSL 2 on Windows or a separate Linux machine for Mac.
3. Which registry and storage folder will I use? Does it already have Traefik, Caddy, nginx / Nginx Proxy Manager, or no proxy? Public HTTPS or a home-only CA?
4. Is this a local build or trusted Forgejo/Woodpecker CI on a separate Linux build machine? Is any existing config backed up?
THEN FOLLOW THE MATCHING PATH:
- Linux: Step 1 installs buildah and uidmap with apt-get, or buildah with dnf. Check non-overlapping subuid/subgid ranges before a rootless build; ask before changing users.
- Windows: use podman build for Dockerfiles, or WSL 2 Ubuntu for scripts. Run podman machine init only once, then podman machine start.
- Mac: Podman for Dockerfiles, Linux for scripts; use the guide's Podman machine steps.
- Docker missing is not a blocker for Buildah; this workflow needs no Docker daemon or socket.
- Registry with Traefik: use its guide's HTTPS route, entrypoints=https and tls.certresolver=le. Buildah itself has no web port.
- Registry with Caddy: use the shown reverse_proxy registry:5000 route. For tls internal, copy only root.crt to ~/.config/containers/certs.d/registry.example.com/ca.crt on Linux. Windows/Mac Podman CA placement is unverified here; stop and read the docs.
- nginx / Nginx Proxy Manager: no recipe here. Do not invent one.
- CI: follow Step 5's host/local backend on a separate machine for trusted repositories only.
Traefik labels from this guide (use its surrounding service/network changes):
- "traefik.enable=true"
- "traefik.http.routers.registry.rule=Host(`registry.example.com`) && PathPrefix(`/v2/`)"
- "traefik.http.routers.registry.entrypoints=https"
- "traefik.http.routers.registry.tls=true"
- "traefik.http.routers.registry.tls.certresolver=le"
- "traefik.http.services.registry.loadbalancer.server.port=5000"
Use ~/docker_volumes/buildah/{data/hello-lab/site,config,logs,backups}; on Windows use $HOME\docker_volumes\buildah. Create site/index.html using Step 2. Save this Dockerfile in data/hello-lab:
FROM docker.io/library/nginx:1.30.8-alpine
COPY site/ /usr/share/nginx/html/
RUN echo "built with buildah" > /usr/share/nginx/html/built-by.txt
Build on Linux: buildah build -t localhost/hello-lab:1.0 .
Windows/Mac: podman build -t localhost/hello-lab:1.0 .
For scripted builds use Step 3's build.sh unchanged. Before pushing, create the local config/registry.env with dummy values replaced on my machine, chmod 600 it and use Step 4's password-stdin login, tag and push commands.
Optional container-build reference only, not a replacement for the host-shell CI job:
image: quay.io/buildah/stable:v1.43.5-immutable
CHECK IT WORKED:
buildah images
ctr=$(buildah from localhost/hello-lab:1.0)
buildah run "$ctr" -- cat /usr/share/nginx/html/built-by.txt
buildah rm "$ctr"
Expect built with buildah. Windows/Mac: podman images and podman run --rm localhost/hello-lab:1.0 cat /usr/share/nginx/html/built-by.txt.
After pushing: skopeo inspect --no-tags docker://registry.example.com/lab/hello-lab:1.0 should return image JSON.
RULES FOR YOU:
Use the guide's Buildah v1.46.1 target and nginx 1.30.8-alpine stable line. Distribution packages may be older. Keep the optional CI container pin v1.43.5-immutable because of the documented overlay-build failures. Never mount docker.sock or request privileged mode for the host workflow. Keep registry credentials out of Git.
On an error, show it and read https://github.com/podman-container-tools/buildah/tree/v1.46.1/docs before guessing. Use only the guide versions, never :latest or invented options. Example domains, paths and <placeholders> are dummies to replace locally. Never ask me to paste passwords, tokens or keys into chat.
Step 1: Install Buildah and check rootless mode#
Rootless builds need the helpers newuidmap and newgidmap and a range of extra user IDs for your user in /etc/subuid and /etc/subgid (Podman rootless tutorial).
Linux#
# Debian, Ubuntu sudo apt-get update sudo apt-get -y install buildah uidmap # Fedora sudo dnf -y install buildah
Then check the version, your ID ranges and rootless mode:
buildah --version grep "^$USER:" /etc/subuid /etc/subgid buildah info | grep -E '"rootless"|"GraphDriverName"'
If the grep prints nothing, ask an administrator to add a range (the Podman tutorial's command; numbers must not overlap with another user):
sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 "$USER"
Windows (PowerShell)#
There is no Windows build of Buildah (install.md lists only Linux distributions). The Podman manual says podman build "uses code sourced from the Buildah project". Two routes:
- Dockerfile builds: install Podman as in our Podman guide. It runs a small Linux virtual machine for you.
- Scripts (
buildah from,run,commit): use WSL 2 with Ubuntu, then follow the Linux commands inside it.
podman machine init podman machine start podman --version wsl --install -d Ubuntu
Run podman machine init only once. The last line installs Ubuntu under WSL 2; open Ubuntu and use the Linux commands there. Its Buildah may be older than 1.46.1 (check buildah --version), and we did not test the steps on it.
Mac (Terminal)#
There is no Mac build either. Use Podman for Dockerfiles and a Linux machine for scripts:
podman machine init podman machine start podman --version
Install Podman as in our Podman guide first.
Check it worked. On Linux, buildah --version prints a line like buildah version <number> (image-spec ..., runtime-spec ...) (shape from an official issue), the grep prints a line per file such as <your-user>:100000:65536, and buildah info shows "rootless": true. On Windows and Mac, podman --version prints a version.
Tip: Every user needs their own range. If two users share one, they can use each other's user namespaces (Podman tutorial).
Step 2: Build an image from a Dockerfile#
We build a tiny web page on top of nginx. We keep 1.30.8-alpine: the official downloads list 1.30.8 as stable and 1.31.10 as mainline on 5 December 2026, so we stay on the same stable line. Everything lives in ~/docker_volumes/buildah (Windows: $HOME\docker_volumes\buildah). The command is buildah build; the older name buildah bud is still in the man page.
Linux#
mkdir -p ~/docker_volumes/buildah/{data/hello-lab/site,config,logs,backups}
cd ~/docker_volumes/buildah/data/hello-lab
cat > site/index.html << 'EOF'
<!doctype html><title>Hello lab</title><h1>Built with Buildah</h1>
EOF
cat > Dockerfile << 'EOF'
FROM docker.io/library/nginx:1.30.8-alpine
COPY site/ /usr/share/nginx/html/
RUN echo "built with buildah" > /usr/share/nginx/html/built-by.txt
EOF
buildah build -t localhost/hello-lab:1.0 .
Windows (PowerShell)#
$base = "$HOME\docker_volumes\buildah"
foreach ($d in "data\hello-lab\site","config","logs","backups") {
New-Item -ItemType Directory -Force "$base\$d" | Out-Null
}
Set-Location "$base\data\hello-lab"
'<!doctype html><title>Hello lab</title><h1>Built with Buildah</h1>' | Set-Content -Encoding ascii site\index.html
@'
FROM docker.io/library/nginx:1.30.8-alpine
COPY site/ /usr/share/nginx/html/
RUN echo "built with buildah" > /usr/share/nginx/html/built-by.txt
'@ | Set-Content -Encoding ascii Dockerfile
podman build -t localhost/hello-lab:1.0 .
Mac (Terminal)#
Same commands as Linux, but the last line is podman build -t localhost/hello-lab:1.0 ..
Full image names avoid a registry search. A tag without a registry gains localhost/. Layers are not cached by default: add --layers or set BUILDAH_LAYERS=true for repeat builds (man page).
Check it worked. The log should end like the official tutorial's: COMMIT ..., Successfully tagged localhost/hello-lab:1.0 and an image ID. Then look inside the image:
buildah images ctr=$(buildah from localhost/hello-lab:1.0) buildah run "$ctr" -- cat /usr/share/nginx/html/built-by.txt buildah rm "$ctr"
The cat prints built with buildah. On Windows and Mac use podman images and podman run --rm localhost/hello-lab:1.0 cat /usr/share/nginx/html/built-by.txt.
Tip: Write full image names (
docker.io/library/alpine:3.23.8), neveralpine. A short name makes Buildah search several registries and ask you to choose (a prompt, issue 6333).
Step 3: Build the same image with a shell script#
A script lets you use if, loops and variables between the steps. The flow follows the official examples/lighttpd.sh: from starts a working container, run and copy change it, config sets image settings, and commit saves the image.
Linux#
cd ~/docker_volumes/buildah/data/hello-lab
cat > build.sh << 'EOF'
#!/usr/bin/env bash
set -euo pipefail
IMAGE="${1:-localhost/hello-lab:1.0-script}"
ctr=$(buildah from docker.io/library/nginx:1.30.8-alpine)
buildah copy "$ctr" site/ /usr/share/nginx/html/
buildah run "$ctr" -- sh -c 'echo "built with buildah" > /usr/share/nginx/html/built-by.txt'
buildah config --port 80 --label org.opencontainers.image.title=hello-lab "$ctr"
buildah commit --rm "$ctr" "$IMAGE"
EOF
chmod +x build.sh
./build.sh
Windows (PowerShell)#
Buildah scripts need Linux. Open Ubuntu in WSL 2 (wsl -d Ubuntu), install Buildah as in Step 1, create the site folder and build.sh from the Linux tab, and run ./build.sh there. We did not run this route.
Mac (Terminal)#
Copy the hello-lab folder to a Linux machine and run the script there (<build-machine> is a placeholder):
scp -r ~/docker_volumes/buildah/data/hello-lab <your-user>@<build-machine>:~/hello-lab ssh <your-user>@<build-machine> 'cd ~/hello-lab && ./build.sh'
Create build.sh on the Mac first with the Linux commands from the tab above, without the ./build.sh line.
The sh -c '...' wrapper matters: in buildah run ctr echo x >> file your shell handles the redirect (the troubleshooting page says to wrap it in bash -c '...'). --rm on commit removes the working container afterwards.
Check it worked. buildah images lists localhost/hello-lab with both tags, and buildah containers shows no leftover working container. buildah inspect --format '{{ .OCIv1.Config.ExposedPorts }}' localhost/hello-lab:1.0-script should list port 80 (we did not run it).
Tip: A script that stops half way leaves a working container behind. List them with
buildah containersand remove them withbuildah rm --all.
Step 4: Push the image to your registry#
Our Docker Registry guide runs a registry at registry.example.com; we reuse its dummy values. The login goes in a chmod 600 file, and the password through stdin so it stays out of shell history and the process list.
Linux#
cd ~/docker_volumes/buildah cat > config/registry.env << 'EOF' REGISTRY_HOST=registry.example.com REGISTRY_USER=change-me REGISTRY_PASSWORD=change-me EOF chmod 600 config/registry.env set -a; . config/registry.env; set +a printf '%s' "$REGISTRY_PASSWORD" | buildah login --username "$REGISTRY_USER" --password-stdin "$REGISTRY_HOST" buildah tag localhost/hello-lab:1.0 "$REGISTRY_HOST/lab/hello-lab:1.0" buildah push "$REGISTRY_HOST/lab/hello-lab:1.0"
Those three values are a dummy - replace them with your own. buildah push <name> works like docker push (man page).
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\buildah"
@'
REGISTRY_HOST=registry.example.com
REGISTRY_USER=change-me
REGISTRY_PASSWORD=change-me
'@ | Set-Content -Encoding ascii config\registry.env
Get-Content config\registry.env | ForEach-Object { $k, $v = $_ -split '=', 2; Set-Item "env:$k" $v }
$env:REGISTRY_PASSWORD | podman login --username $env:REGISTRY_USER --password-stdin $env:REGISTRY_HOST
podman tag localhost/hello-lab:1.0 "$env:REGISTRY_HOST/lab/hello-lab:1.0"
podman push "$env:REGISTRY_HOST/lab/hello-lab:1.0"
Mac (Terminal)#
Same commands as Linux, with podman instead of buildah.
For a plain-HTTP registry (not recommended) add --tls-verify=false to login and push, always with the equals sign: the login man page says the spaced form is not accepted (issue 6375). Better: HTTPS (next section).
Check it worked. buildah login prints Login Succeeded! (the man page's example). Then read the image from the registry without pulling it, with Skopeo from our Skopeo guide:
skopeo inspect --no-tags docker://registry.example.com/lab/hello-lab:1.0
It prints a JSON document with the digest and layers. Anyone with Docker can now test it with docker pull registry.example.com/lab/hello-lab:1.0.
Tip: On Linux the login is stored in
${XDG_RUNTIME_DIR}/containers/auth.json, a runtime folder that usually disappears at logout or reboot (containers-auth.json page). In a script or CI job setREGISTRY_AUTH_FILE=<path>or log in at the start of every job. On Windows and Mac the file is$HOME/.config/containers/auth.json.
Step 5: Build in CI as a normal user, without docker.sock#
The rule for this step: no docker.sock and no privileged. Run Buildah as a plain user on a separate build machine, and let the Forgejo or Woodpecker runner start jobs as that user (Forgejo calls it host mode, Woodpecker the local backend). There are two ways to run Buildah in CI, and neither is free:
| Way | What the docs and issues say |
|---|---|
| Job runs as your build user on the machine (host or local mode) | Forgejo: "There is no isolation at all and a single job can permanently destroy the host". Woodpecker: no isolation either. Use it only for repositories you trust, on a machine you can rebuild |
| Job runs in a container that runs Buildah | Needs user namespaces inside the container, which Docker's default profile blocks (issue 2262), so privileged or a relaxed profile. Builds in unprivileged pods broke on 1.44 and newer (issues 6910, 7264) |
A Forgejo workflow's container.options accepts only --volume, --tmpfs, --hostname and --memory, so a workflow cannot ask for a relaxed profile. We use the first way. We ran neither.
Linux#
Set up the build machine (Debian or Ubuntu shown). The Forgejo docs use a runner user; it needs a subuid range like any rootless user.
sudo apt-get update sudo apt-get -y install buildah uidmap git nodejs sudo useradd --create-home --shell /bin/bash runner grep '^runner:' /etc/subuid /etc/subgid sudo loginctl enable-linger runner
If the grep is empty, add a range as in Step 1. enable-linger keeps the user's runtime folder /run/user/<id> alive (our reading, not a documented step). Node.js is there because actions/checkout is a JavaScript action (the docs note that actions can need NodeJS; not tested).
Forgejo. Install the runner binary as in the docs (Installation from binary). As the runner user, generate the config:
sudo -u runner -H bash -c 'cd ~ && forgejo-runner generate-config > runner-config.yml'
Edit /home/runner/runner-config.yml to hold a server connection and the host label (the docs' label form is <name>:host):
server:
connections:
forgejo:
url: https://git.example.com/
uuid: <UUID-from-Forgejo>
token: <TOKEN-from-Forgejo>
runner:
labels:
- buildah:host
Then start it (the docs require -c; there is no default config path):
sudo -u runner -H bash -c 'cd ~ && forgejo-runner daemon -c runner-config.yml'
The URL, UUID and token are dummies; create the real runner as in our Forgejo guide. Run the daemon from the docs' systemd unit. The docs advise ephemeral runners for host mode, because the job can read the runner token.
Woodpecker. Install the agent as in the docs, run it not as root, and set the local backend. The backend gives each workflow an isolated HOME by default, which would discard Buildah's storage every time, so we turn that off:
WOODPECKER_SERVER=<woodpecker-host>:9000 WOODPECKER_AGENT_SECRET=<your-agent-secret> WOODPECKER_BACKEND=local WOODPECKER_BACKEND_LOCAL_ISOLATED_HOME=false
Without Docker on the machine, the default clone step (a container image) cannot run: the platforms page says to use the plugin-git binary or clone yourself, and we did not set that up. Our Woodpecker guide covers the server.
Windows (PowerShell)#
The build machine is Linux, so here you only add the workflow file to your repository and push it:
New-Item -ItemType Directory -Force .forgejo\workflows | Out-Null
@'
on:
push:
branches:
- main
jobs:
image:
runs-on: buildah
steps:
- uses: actions/checkout@v7
- name: Build
run: buildah build -t "registry.example.com/lab/hello-lab:${{ forgejo.sha }}" .
- name: Push
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
printf '%s' "$REGISTRY_PASSWORD" | buildah login --username "$REGISTRY_USER" --password-stdin registry.example.com
buildah push "registry.example.com/lab/hello-lab:${{ forgejo.sha }}"
- name: Log out
if: always()
run: buildah logout registry.example.com
'@ | Set-Content -Encoding ascii .forgejo\workflows\build.yaml
git add .forgejo/workflows/build.yaml
git commit -m "Build the image with Buildah"
git push
In the repository's Actions settings add the secrets REGISTRY_USER and REGISTRY_PASSWORD (dummy: change-me). The workflow reads them as ${{ secrets.KEY }}; Forgejo keeps them empty for pull requests from forks. actions/checkout@v7 is the version in the Forgejo quick start.
Mac (Terminal)#
Same file and secrets as on Windows:
mkdir -p .forgejo/workflows
cat > .forgejo/workflows/build.yaml << 'EOF'
on:
push:
branches:
- main
jobs:
image:
runs-on: buildah
steps:
- uses: actions/checkout@v7
- name: Build
run: buildah build -t "registry.example.com/lab/hello-lab:${{ forgejo.sha }}" .
- name: Push
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
printf '%s' "$REGISTRY_PASSWORD" | buildah login --username "$REGISTRY_USER" --password-stdin registry.example.com
buildah push "registry.example.com/lab/hello-lab:${{ forgejo.sha }}"
- name: Log out
if: always()
run: buildah logout registry.example.com
EOF
git add .forgejo/workflows/build.yaml
git commit -m "Build the image with Buildah"
git push
Woodpecker version (.woodpecker/build.yaml). The label picks local-backend agents, and $${...} leaves the variable for the shell (secrets page). Add the secrets registry_user and registry_password in the UI:
labels:
backend: local
when:
- event: push
branch: main
steps:
- name: build-and-push
image: bash
environment:
REGISTRY_USER:
from_secret: registry_user
REGISTRY_PASSWORD:
from_secret: registry_password
commands:
- buildah build -t registry.example.com/lab/hello-lab:${CI_COMMIT_SHA} .
- printf '%s' "$${REGISTRY_PASSWORD}" | buildah login --username "$${REGISTRY_USER}" --password-stdin registry.example.com
- buildah push registry.example.com/lab/hello-lab:${CI_COMMIT_SHA}
- buildah logout registry.example.com
Check it worked. The Actions tab (or the Woodpecker pipeline) shows the run green, and skopeo inspect --no-tags docker://registry.example.com/lab/hello-lab:<commit-sha> shows the new tag. If the job waits forever, the runs-on label (or the Woodpecker backend: local label) matches no online runner.
Tip: If you must build in a container anyway, pin
quay.io/buildah/stable:v1.43.5-immutable:-immutabletags are never overwritten, plain version tags are rebuilt daily (image build README). Pass--storage-driver=vfsas a flag; users report theSTORAGE_DRIVERvariable has no effect (issue 6282).
The optional container-build pin from the tip above, shown as an image field for reference (the host-mode jobs above use their host shell):
image: quay.io/buildah/stable:v1.43.5-immutable
Put it behind HTTPS with Traefik? Buildah does not need it, your registry does#
Buildah has no port and no web page, so there is nothing to put behind a proxy. The registry you push to needs HTTPS: Buildah checks TLS by default (--tls-verify is true). Use the routes from our Docker Registry guide.
With Traefik#
On a server with a domain, the registry guide adds these labels to the registry service (our Traefik guide has the base setup):
labels:
- "traefik.enable=true"
- "traefik.http.routers.registry.rule=Host(`registry.example.com`) && PathPrefix(`/v2/`)"
- "traefik.http.routers.registry.entrypoints=https"
- "traefik.http.routers.registry.tls=true"
- "traefik.http.routers.registry.tls.certresolver=le"
- "traefik.http.services.registry.loadbalancer.server.port=5000"
A public Let's Encrypt certificate needs nothing on the Buildah side.
Without Traefik: Caddy#
The registry guide's Caddyfile (shortened here) gets Let's Encrypt certificates for a public domain:
registry.example.com {
handle /v2/* {
reverse_proxy registry:5000
}
}
At home, add tls internal inside the site block. Caddy then signs with its own local certificate, so Buildah must trust Caddy's root. Copy the public root.crt (never the private key) to the build machine as ca.crt:
mkdir -p ~/.config/containers/certs.d/registry.example.com cp root.crt ~/.config/containers/certs.d/registry.example.com/ca.crt
That folder works for rootless users (containers-certs.d page). Its name must match the registry name exactly, port included if the image name has one. On Windows and Mac Podman runs inside its machine, and we did not verify where the certificate goes there. Check with curl -I https://registry.example.com/v2/: it should print an authentication challenge, not a certificate error.
Security and testing#
| Control | How |
|---|---|
| Normal user | Never sudo buildah for a routine build. Rootless means root inside the build is only your user outside |
No docker.sock, no --privileged | Not needed for the host-mode design; both give a job root-level power over the host |
| CI secrets | Registry login in Forgejo or Woodpecker secrets, never in the repository |
| Host-mode runner | No isolation: private repositories only, on a machine you can rebuild |
| Login file | auth.json holds the login base64-encoded, which is not encryption. chmod 600, or log out after each job |
| Build secrets | buildah build --secret id=mysecret,src=<file> with RUN --mount=type=secret,id=mysecret ...: the secret stays out of the image (man page) |
| Base images | Pin full names and tags; scan the result with our Trivy guide or Grype and Syft guide |
Quick tests:
buildah --version buildah info | grep -E '"rootless"|"GraphDriverName"' buildah images buildah login --get-login registry.example.com
Common mistakes#
| Mistake | Why it happens | Do this instead |
|---|---|---|
FROM alpine with a short name (issue 2048, issue 6333) | Buildah tries the registries in registries.conf one by one, or asks you to pick | Write docker.io/library/alpine:3.23.8. A CI job has no keyboard to answer |
chown: changing ownership of '/opt/app': Invalid argument in a rootless build (issue 1731) | The ID is outside your user's /etc/subuid range, so the user namespace has no such ID | Add a range with usermod --add-subuids ... --add-subgids ..., check with grep |
newuidmap: write to uid_map failed: Operation not permitted (issue 3834) | newuidmap lost its file capability; a maintainer's fix on Fedora was rpm --restore shadow-utils | Install uidmap (Debian), or restore the package; check getcap $(which newuidmap) |
--tls-verify false with a space (issue 6375) | It is a true/false flag: the next word is read as the registry name | Write --tls-verify=false, or better, fix the certificate |
A HEALTHCHECK is missing from the image | Default format is OCI; the buildah config man page says healthcheck settings are discarded in OCI formats (we did not test a Dockerfile one) | Build with --format docker if you need it |
| Slow rebuilds | --layers is false by default: no step cache | Add --layers or export BUILDAH_LAYERS=true |
Storage on NFS, or rootless overlay without fuse-overlayfs | NFS does not understand user namespaces; overlay needs mknod or the helper | Use a local disk, or install fuse-overlayfs and set mount_program (troubleshooting page) |
| "unauthorized" after a reboot | The login file lives in /run/user/<id> and is gone | Log in again, or set REGISTRY_AUTH_FILE to a file you keep |
AI assistants: buildah run ctr echo "x" >> file | Your own shell handles >> | buildah run ctr -- sh -c 'echo "x" >> file' |
AI assistants: buildah build --push or --load | Copied from docker buildx; we found no --push in the buildah build man page | buildah build -t name ., then buildah push name |
AI assistants: "mount /var/run/docker.sock" or "use --privileged" in CI | Habit from Docker-in-Docker setups | Run Buildah as a normal user on a build machine (Step 5) |
AI assistants: the old github.com/containers/buildah address, or quay.io/buildah/stable:latest | Older tutorials. The repository moved, and the stable image jumped from 1.43 to 1.45 around 10 November 2026 | Use podman-container-tools/buildah and an exact tag |
Tip: The first time something fails, add
--log-level debug. Errors fromnewuidmaporunshareshow there, not in the last line.
Tip: Check an issue's date before copying its fix. Two tickets above are from 2019 and 2022: the error texts are real, but the tools around them have changed.
Troubleshooting#
| Problem | Solution |
|---|---|
no such image, or a registry search error | Use a full image name; check that /etc/containers/registries.conf exists (package containers-common) |
http: server gave HTTP response to HTTPS client | Put HTTPS on the registry, or use --tls-verify=false for a test |
unauthorized on push | buildah login --get-login <registry>, then log in again |
| Rootless build cannot chown or map IDs | grep "^$USER:" /etc/subuid /etc/subgid; add ranges; check newuidmap |
| Old working containers pile up | buildah containers, then buildah rm --all |
| Disk is full | buildah rmi --prune, then buildah prune |
| CI worked yesterday, fails today | The image tag moved. Pin v1.43.5-immutable (Step 5) |
Exact error texts#
error building: error creating build container: no such image "alpine" in registry: image not known: the short name has nowhere to go (official troubleshooting page).Error during unshare(CLONE_NEWUSER): Operation not permitted: a container may not create user namespaces (issue 2262).error setting supplemental groups list: operation not permitted:--isolation chrootin a single-ID user namespace (issue 6947); the v1.45.0 release notes list the fix, so v1.46.1 has it.Error: mounting an overlay over build context directory: creating overlay scaffolding for build context directory: mount overlay:...: permission denied: the open CI problem of 1.44 and newer (issue 7264).Error while applying layer: ApplyLayer exit status 1 stdout: stderr: open /root/.bash_logout: permission denied: rootless storage on NFS (troubleshooting page).Error: /var/lib/containers/storage contains several valid graphdrivers: vfs, overlay; Please cleanup or explicitly choose storage driver (-s <DRIVER>)(issue 6282): pass--storage-driver.
Known bugs (open, December 2026)#
Issues 6910 and 7264: builds in unprivileged CI containers fail on 1.44 and newer; a fix attempt (pull request 6126) was still open on 5 December. Issue 7257: COPY --from rounds file times to the nearest second, which can break Python bytecode compiled in an earlier stage. We found nothing that stops a normal host install.
Updates and backups#
Update. Read the release notes, then upgrade with your package manager (sudo apt-get install --only-upgrade buildah or sudo dnf upgrade buildah), or change the pinned CI tag. Check with buildah --version.
What to back up. Your recipes and settings: data (Dockerfiles, scripts) and config (registry.env holds a login, so keep the archive private). Skip the image storage in ~/.local/share/containers: you can rebuild it.
Linux and Mac#
Save as ~/docker_volumes/buildah/backup.sh:
#!/usr/bin/env bash set -euo pipefail base="$HOME/docker_volumes/buildah" out="$base/backups/buildah-$(date +%F).tar.gz" tar -czf "$out" -C "$base" data config chmod 600 "$out"
Run chmod 700 on it and add this line with crontab -e (on a Mac write /Users/<your-user>/...):
0 3 * * * /home/<your-user>/docker_volumes/buildah/backup.sh
Windows (PowerShell)#
Save as $HOME\docker_volumes\buildah\backup.ps1:
$base = "$HOME\docker_volumes\buildah" $out = "$base\backups\buildah-$(Get-Date -Format yyyy-MM-dd).tar.gz" tar.exe -czf $out -C $base data config
In Task Scheduler run powershell.exe -NoProfile -File <full-path-to-the-script> daily at 03:00.
Restore test#
Unpack the archive into a spare folder, then build from it:
mkdir -p ~/restore-test && tar -xzf ~/docker_volumes/buildah/backups/buildah-<date>.tar.gz -C ~/restore-test cd ~/restore-test/data/hello-lab buildah build -t localhost/hello-lab:restore .
The build should succeed. We did not run this restore.
Performance and resources#
The docs give no minimum RAM or CPU, and we measured none. Three things decide speed and disk use. Storage driver: Buildah picks the best one for your platform if none is set (containers-storage.conf page); valid rootless drivers are overlay, btrfs and vfs. vfs works almost anywhere, but as far as we know it copies every layer in full (more time and disk; the docs give no numbers). Layer cache: turn on --layers. Cleanup: buildah prune and buildah rmi --prune. To see the real numbers on your machine, use time buildah build ... and du -sh ~/.local/share/containers.
FAQ#
Is Buildah a replacement for Docker? Only for building. It does not run long-lived containers; our Podman guide does. Images built by Buildah run on Docker, Podman and Kubernetes.
Do I need Buildah if I have Podman? Not for Dockerfiles: podman build uses Buildah's code. You need buildah itself for the scripted from, run, commit way.
Can Buildah read my existing Dockerfile? Yes. Differences: the default format is OCI, and layers are not cached unless you ask.
Why does the repository address redirect? The project moved from containers/buildah to podman-container-tools/buildah in 2026. Use the new one in notes and scripts.
Where is the image storage? In ~/.local/share/containers/storage for a normal user (man page), separate from Docker's.
Sources#
Upgrade review, read 5 December 2026: NGINX downloads (stable and mainline) and changelog through 1.31.10. We retain stable 1.30.8.
Buildah: repository, buildah.io and its release announcements (repository move); release v1.46.1 (11 November 2026); LICENSE (Apache-2.0)
At tag v1.46.1: README, install.md, troubleshooting.md, lighttpd.sh and the man pages for build, from, run, copy, config, commit, push and login
Container image: image build README and quay.io/buildah/stable (tags checked through the Quay API)
Shared docs: containers-auth.json, containers-certs.d, containers-storage.conf, Podman rootless tutorial, podman-build manual
CI: Forgejo Actions reference, security, installation from binary, quick start; Woodpecker v3.20.1 local backend, workflow syntax, secrets, platforms
Issues read: 1731, 2048, 2262, 3834, 6282, 6333, 6375, 6910, 6947, 7257, 7264
Distribution versions: Launchpad, Fedora Bodhi (5 December 2026)
Checked against the official docs on 2026-12-05 (upgrade review; earlier setup-source dates are shown above). Nothing was run on a real machine by DIY Lab Hub; the commands come from the man pages, the docs and the issues above.