fix(docker-build-push): reset the buildkit state volume when the builder fails to boot #82

Merged
cjournois merged 1 commit from fix/buildkit-state-reset into main 2026-10-31 11:56:34 +00:00
Collaborator

After 5.3.4, image builds still fail on ergon #73, janus #95, resume #105 and warden #113: the fresh buildkit container crash-loops on "could not lock /var/lib/buildkit/buildkitd.lock" because docker rm -f kept the state volume whose lock an orphaned buildkitd holds.

Verified: just lint test green (505); on a real daemon with that lock held outside docker, the 5.3.4 script fails the same way and this one resets, boots and builds.
Run: https://git.journois.com/project/ergon/actions/runs/350

Session: 4cd08b74-eaaa-4c47-9419-40b5b184ec33

After 5.3.4, image builds still fail on ergon #73, janus #95, resume #105 and warden #113: the fresh buildkit container crash-loops on "could not lock /var/lib/buildkit/buildkitd.lock" because `docker rm -f` kept the state volume whose lock an orphaned buildkitd holds. Verified: `just lint test` green (505); on a real daemon with that lock held outside docker, the 5.3.4 script fails the same way and this one resets, boots and builds. Run: https://git.journois.com/project/ergon/actions/runs/350 Session: 4cd08b74-eaaa-4c47-9419-40b5b184ec33
fix(docker-build-push): reset the buildkit state volume when the builder fails to boot
All checks were successful
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 5m49s
ci: reusable-pipeline / CI Pipeline (push) Successful in 6m10s
1cc9090e72
5.3.4 removed the stuck container but kept buildx_buildkit_ci-builder0_state, whose buildkitd.lock an orphaned buildkitd still holds, so every new container crash-looped with "could not lock /var/lib/buildkit/buildkitd.lock" (ergon #73, janus #95, resume #105, warden #113).
The builder is now booted before the build; on failure it is removed with its state volume and booted once more, unless it is cleanly running (another job just created it).
Reproduced on a real daemon with a lock held outside docker: 5.3.4 fails, this heals and builds.

Session: 4cd08b74-eaaa-4c47-9419-40b5b184ec33
cjournois changed title from WIP: fix(docker-build-push): reset the buildkit state volume when the builder fails to boot to fix(docker-build-push): reset the buildkit state volume when the builder fails to boot 2026-10-31 11:56:25 +00:00
cjournois deleted branch fix/buildkit-state-reset 2026-10-31 11:56:34 +00:00
bot-claude left a comment

cjournois asked for changes before merging:

Merged

cjournois asked for changes before merging: Merged
Sign in to join this conversation.
No reviewers
No labels
needs-human
No milestone
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
cjournois/reusable-pipeline!82
No description provided.