Skip to content

fix(ci): create buildx builder in the build step's DOCKER_CONFIG - #2962

Merged
myasnikovdaniil merged 1 commit into
mainfrom
ci/buildx-docker-config
Jun 22, 2026
Merged

fix(ci): create buildx builder in the build step's DOCKER_CONFIG#2962
myasnikovdaniil merged 1 commit into
mainfrom
ci/buildx-docker-config

Conversation

@myasnikovdaniil

@myasnikovdaniil myasnikovdaniil commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What this PR does

The Build cache (main) workflow (build-main.yaml, added in #2948) failed on
its first run: https://github.com/cozystack/cozystack/actions/runs/27929277423

The Set up Buildx step ran without DOCKER_CONFIG, so
docker/setup-buildx-action created the docker-container builder under the
runner's default ~/.docker. The build step runs with
DOCKER_CONFIG=$RUNNER_TEMP/.docker (seeded earlier, holding the OCIR auth), so
buildx couldn't find the builder and failed immediately:

ERROR: no builder "builder-6fb46242-…" found

The post-job docker buildx rm still succeeded — because the action's cleanup
runs under the default config where the builder actually lived — which confirms
the builder existed but in the wrong config store.

This sets DOCKER_CONFIG on the Set up Buildx step so the builder instance is
created in the same config the build step reads.

Impact: only the main cache-warmer was broken. PR builds --cache-from this
ref, so a missing cache is a cold build, not a failure — but the warm-cache
speedup from #2948 wasn't being delivered until this fix.

Release note

NONE

Summary by CodeRabbit

  • Chores
    • Improved build pipeline stability by ensuring consistent Docker configuration across workflow steps. This enhances the reliability of the container build and deployment process.

The "Set up Buildx" step in build-main.yaml ran without DOCKER_CONFIG, so
docker/setup-buildx-action created the docker-container builder under the
default ~/.docker. The build step runs with DOCKER_CONFIG=$RUNNER_TEMP/.docker
(seeded before the builder existed and holding the OCIR auth), so it could not
find the builder and failed immediately with `no builder "builder-<uuid>"
found`. The post-job `docker buildx rm` still succeeded because the action's
cleanup runs under the default config where the builder actually lived.

Set DOCKER_CONFIG on the Set up Buildx step so the builder instance is created
in the same config the build step reads.

Assisted-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot added area/ci Issues or PRs related to CI workflows, GitHub Actions, automation kind/bug Categorizes issue or PR as related to a bug size/XS This PR changes 0-9 lines, ignoring generated files labels Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ed85608d-bca9-45de-ac94-93f89e3cdf01

📥 Commits

Reviewing files that changed from the base of the PR and between aeaedca and e7abea9.

📒 Files selected for processing (1)
  • .github/workflows/build-main.yaml

📝 Walkthrough

Walkthrough

In the warm-cache workflow job, an env block is added to the "Set up Buildx (docker-container driver)" step, setting DOCKER_CONFIG to ${{ runner.temp }}/.docker. This aligns the Docker config directory used during Buildx instance creation with the directory used by subsequent build steps.

Changes

CI Buildx Config Fix

Layer / File(s) Summary
DOCKER_CONFIG env for Buildx setup step
.github/workflows/build-main.yaml
Adds env.DOCKER_CONFIG: ${{ runner.temp }}/.docker to the Buildx setup step in the warm-cache job, with inline comments explaining it must match the build step's config path to avoid "no builder found" failures.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hops through Docker's maze,
configs mismatched set the cache ablaze.
One small env, a temp dir set right,
the builder is found — no error in sight!
🐇✨ No more lost builders tonight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main fix: setting DOCKER_CONFIG environment variable in the buildx builder setup step to resolve the CI workflow failure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/buildx-docker-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dosubot dosubot Bot added the area/build Issues or PRs related to image build infrastructure, multi-arch support label Jun 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — the fix correctly aligns the buildx builder's config store with the build step's DOCKER_CONFIG; mechanism verified end-to-end against the workflow.

Business context: the main cache-warmer (build-main.yaml, #2948) failed on its first run because the buildx builder was created in the default ~/.docker while the build step reads DOCKER_CONFIG=$RUNNER_TEMP/.docker, so --builder couldn't find it ("no builder found").

Verified end-to-end: "Set up Docker config" seeds $RUNNER_TEMP/.docker, "Login to OCIR" writes the auth there, and the build step reads BUILDER from steps.buildx.outputs.name under that same config — so creating the builder instance under the same DOCKER_CONFIG is the right and minimal fix. No blockers.

Non-blocking follow-up

  1. DOCKER_CONFIG: ${{ runner.temp }}/.docker is now repeated on three steps (login, buildx setup, build). Hoisting it to the job-level env: would make the warm-cache job self-consistent by construction and prevent exactly this "forgot it on one step" foot-gun from recurring. Optional — the per-step form here is correct as-is.

@myasnikovdaniil
myasnikovdaniil merged commit 6329ffe into main Jun 22, 2026
12 checks passed
@myasnikovdaniil
myasnikovdaniil deleted the ci/buildx-docker-config branch June 22, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Issues or PRs related to image build infrastructure, multi-arch support area/ci Issues or PRs related to CI workflows, GitHub Actions, automation kind/bug Categorizes issue or PR as related to a bug size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants