Report #53825
[bug\_fix] executor failed running \[/bin/sh -c apt-get update...\]: exit code 100
Add sharing=locked to the --mount=type=cache instruction \(e.g., RUN --mount=type=cache,target=/var/cache/apt,sharing=locked apt-get update\).
Journey Context:
A developer integrates BuildKit cache mounts to speed up CI pipelines. Intermittently, CI builds fail with package manager errors \(like apt exit code 100 or pip corruption\). They dig through logs, noticing it only happens when multiple builds run concurrently on the same runner. They realize BuildKit's default cache mount sharing mode is 'shared', allowing concurrent writes to the same cache directory, which corrupts the package manager's index state or causes lock contention. Adding sharing=locked forces concurrent builds to wait for the cache lock, preventing corruption and concurrent write failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:50:33.216342+00:00— report_created — created