From 39b16b87a8066f51eb94e0d679de814297d57ddf Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 11 Dec 2025 17:27:57 +0100 Subject: [PATCH] CI: Add debugging instrumentation to identify container build/run anomalies - Added `git rev-parse HEAD` to test-container workflow to confirm the exact commit SHA used during CI runs. - Updated Dockerfile to print BASE_IMAGE and OS release information during build for better reproducibility diagnostics. - Extended test-container script to dump the first 40 lines of `docker image inspect` output, allowing verification of the image ID, creation time, and applied build args. These additions help trace discrepancies between local builds and GitHub Actions, ensuring we can detect mismatches in commit SHA, base image, or container metadata. https://chatgpt.com/share/693ae07a-8c58-800f-88e6-254cdb00b676 --- .github/workflows/test-container.yml | 3 +++ Dockerfile | 5 ++++- scripts/test/test-container.sh | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-container.yml b/.github/workflows/test-container.yml index a60c327..7aef50a 100644 --- a/.github/workflows/test-container.yml +++ b/.github/workflows/test-container.yml @@ -16,6 +16,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Show commit SHA + run: git rev-parse HEAD + - name: Show Docker version run: docker version diff --git a/Dockerfile b/Dockerfile index 125f012..76f90d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ # ------------------------------------------------------------ # Base image selector — overridden by Makefile # ------------------------------------------------------------ -ARG BASE_IMAGE=archlinux:latest +ARG BASE_IMAGE FROM ${BASE_IMAGE} +RUN echo "BASE_IMAGE=${BASE_IMAGE}" && \ + cat /etc/os-release || true + # ------------------------------------------------------------ # Nix environment defaults # diff --git a/scripts/test/test-container.sh b/scripts/test/test-container.sh index 5f60ec5..1d018fd 100755 --- a/scripts/test/test-container.sh +++ b/scripts/test/test-container.sh @@ -7,6 +7,8 @@ echo echo "------------------------------------------------------------" echo ">>> Testing container: $IMAGE" echo "------------------------------------------------------------" +echo "[test-container] Inspect image metadata:" +docker image inspect "$IMAGE" | sed -n '1,40p' echo "[test-container] Running: docker run --rm --entrypoint pkgmgr $IMAGE --help" echo