From 43949b20a008d44d14fb1788dfdc8033a479c813 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Sat, 9 May 2026 19:41:55 -0500 Subject: [PATCH] Build soul-demo image tar before Docker build in stage Dockerfile.stage COPYs dist/soul-demo-image.tar so k3s can import soul-demo:local at container startup. Stage CI now compiles soul-demo from source on the host runner and packages it as an OCI image before the main Docker build runs. --- .gitea/workflows/stage.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitea/workflows/stage.yaml b/.gitea/workflows/stage.yaml index 2450e6d..f51ce20 100644 --- a/.gitea/workflows/stage.yaml +++ b/.gitea/workflows/stage.yaml @@ -111,6 +111,27 @@ jobs: # in the build context for Dockerfile COPY to succeed. run: touch src/index.html src/about.html src/terms.html src/enterprise-terms.html + - name: Build soul-demo image tar + # Dockerfile.stage COPYs dist/soul-demo-image.tar so k3s can import + # soul-demo:local at runtime. We compile soul-demo from source on the + # host runner (ci-base has gcc), build a minimal OCI image, and save it. + # Runs before the main Docker build so the COPY succeeds. + if: steps.changetype.outputs.asset_only != 'true' + run: | + set -euo pipefail + # Compile el_runtime.o and soul-demo on the host runner + cc -O2 -DHAVE_CURL -c runtime/el_runtime.c -I runtime/ -o /tmp/el_runtime.o + cc -O2 -rdynamic -DEL_SOUL_DEMO_BUILD \ + -o dist/soul-demo \ + dist/soul-demo.c dist/vessel_stubs.c /tmp/el_runtime.o \ + -lcurl -lpthread -ldl -lm -lssl -lcrypto + echo "soul-demo compiled: $(ls -lh dist/soul-demo)" + # Package as minimal OCI image for k3s import + docker build -f dist/Dockerfile.soul-demo -t soul-demo:local dist/ + docker save soul-demo:local -o dist/soul-demo-image.tar + echo "soul-demo-image.tar: $(du -sh dist/soul-demo-image.tar | cut -f1)" + docker rmi soul-demo:local 2>/dev/null || true + # ── El SDK setup ────────────────────────────────────────────────────── - name: Extract El SDK from ci-base