Self-hosted GitHub Actions runners produce incomplete multi-stage Docker images after kernel update (overlay2: missing build artifacts)
Environment
CI: GitHub Actions self-hosted Ubuntu 20.04 runners with Docker Engine 20.10 using overlay2 on ext4; runners are VMs on on-prem KVM cluster; CI builds multi-stage Dockerfiles that copy artifacts from builder stage to final stage; recent host kernel updated from 5.4.0-xx to 5.11.0-xx.
Symptoms
Several CI jobs started failing after kernel update: final Docker image missing binary artifacts that were present in builder stage; container unpacks appear successful but runtime errors 'executable not found' or 0-byte files in /app/bin; rebuilding the same Dockerfile locally on developer machines reproduces clean image.
Observations
Build logs show successful 'COPY --from=builder /app/dist /app/dist' steps with no errors; running intermediate 'builder' image in CI runner shows artifacts present inside builder stage; final image filesystem lacks files or contains zero-length placeholders. docker build uses BuildKit disabled; daemon logs show overlay2 'link delete' warnings at times; host kernel logs contain overlayfs WARN messages referencing missing dentry and delayed lowerdir cleanup around build time.
Already attempted
Downgraded Docker daemon to previous minor release (no effect); rebuilt images with --no-cache (same result); enabled BuildKit on CI runner (changed behavior: artifacts present but image larger and a different failure later); moved runner to another host without kernel update — builds succeed there; preserved failing host journalctl and /var/log/docker logs.
Question
What kernel/overlay2 interactions or race conditions can cause copied files to vanish from final multi-stage images on self-hosted runners, and what reversible checks and mitigations should I perform to confirm overlayfs corruption vs Docker bug vs CI runner host config?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags