fix(ci): use inline build cache (Forgejo registry can't write buildcache blobs) #3

Merged
james merged 1 commit from fix/ci-buildcache into main 2026-07-24 14:14:50 +00:00
Owner

Problem

The build-and-push job on the last run pushed the image fine (:latest and :0.4.2.106) but then failed at:

#19 exporting cache to registry
ERROR: error writing layer blob: unknown
ERROR: failed to build: failed to solve: error writing layer blob: unknown

That failed the job and blocked the deploy to Media/citadel. It's a known limitation: Forgejo/Gitea's container registry doesn't reliably support buildkit's separate registry cache manifest (cache-to: type=registry,mode=max).

Fix

Switch to inline cache — cache metadata is embedded in the :latest image that already pushes successfully, so there's no separate cache blob write to fail:

  • cache-from: type=registry,ref=…/baktainer:latest
  • cache-to: type=inline

The :buildcache tag is no longer used.

Note: the previous run's image is already in the registry, but the deploy never fired. After this merges, the next push to main will build + deploy; or the deploy can be triggered manually.

🤖 Generated with Claude Code

## Problem The `build-and-push` job on the last run **pushed the image fine** (`:latest` and `:0.4.2.106`) but then failed at: ``` #19 exporting cache to registry ERROR: error writing layer blob: unknown ERROR: failed to build: failed to solve: error writing layer blob: unknown ``` That failed the job and **blocked the deploy** to Media/citadel. It's a known limitation: Forgejo/Gitea's container registry doesn't reliably support buildkit's separate registry cache manifest (`cache-to: type=registry,mode=max`). ## Fix Switch to **inline cache** — cache metadata is embedded in the `:latest` image that already pushes successfully, so there's no separate cache blob write to fail: - `cache-from: type=registry,ref=…/baktainer:latest` - `cache-to: type=inline` The `:buildcache` tag is no longer used. Note: the previous run's image is already in the registry, but the deploy never fired. After this merges, the next push to `main` will build + deploy; or the deploy can be triggered manually. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Forgejo's container registry can't write buildkit's separate cache
manifest: the build-and-push job pushed the image successfully but then
failed at "exporting cache to registry" with "error writing layer blob:
unknown", failing the job and blocking the deploy.

Switch cache-to from type=registry (:buildcache, mode=max) to type=inline,
which embeds cache metadata in the :latest image we already push — no
separate cache blob write to fail — and read cache-from :latest.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
james merged commit a1b72d07a6 into main 2026-07-24 14:14:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/baktainer!3
No description provided.