Single-stage Dockerfile.stage: pre-download k3s on host runner
Dev — Build & local smoke test / build-smoke (pull_request) Failing after 1m37s

The multi-stage Docker builder (which installed build-essential, compiled
soul-demo, and downloaded k3s inside Docker) was causing RWLayer nil
corruption on the runner's overlay2 driver. Every affected run failed at
apt-get install in the runtime stage after the builder stage completed.

Fix: move k3s download to the CI host runner (same pattern as soul-demo
compilation, which now passes reliably). Dockerfile.stage becomes single-
stage: no apt-get in a builder stage, no network downloads, just COPY of
pre-built binaries. Also adds --no-cache to the main docker build for
consistency with the soul-demo step fix.
This commit is contained in:
2026-05-10 11:26:23 -05:00
parent 5e1344af42
commit e6fd110073
2 changed files with 31 additions and 47 deletions
+17 -2
View File
@@ -196,13 +196,28 @@ jobs:
echo "soul-demo-image.tar: $(du -sh dist/soul-demo-image.tar | cut -f1)"
docker rmi soul-demo:local 2>/dev/null || true
- name: Download k3s binary
# Pre-download k3s on the host runner so Dockerfile.stage can COPY it
# directly. Previously k3s was downloaded inside the Docker builder stage,
# which combined with build-essential and C compilation caused RWLayer nil
# corruption on the runner's overlay2 driver. Host-runner download is safe.
if: steps.changetype.outputs.asset_only != 'true'
run: |
set -euo pipefail
curl -fL --retry 3 --retry-delay 10 \
https://github.com/k3s-io/k3s/releases/download/v1.32.4%2Bk3s1/k3s \
-o dist/k3s
chmod +x dist/k3s
echo "k3s: $(ls -lh dist/k3s)"
- name: Build and tag image
if: steps.changetype.outputs.asset_only != 'true'
run: |
set -euo pipefail
# --no-cache: prevents reuse of corrupted overlay2 layers from prior failed runs.
# Dockerfile.stage is now single-stage (no builder) so build is fast even without cache.
docker build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--cache-from us-central1-docker.pkg.dev/neuron-785695/neuron-marketing/marketing:stage-latest \
--no-cache \
-f Dockerfile.stage \
-t "marketing:${{ steps.tag.outputs.tag }}" \
.