From 3eba5435c48365d8796e8ae5f545bc60fe2d284f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 18:25:07 +0000 Subject: [PATCH 1/2] Initial plan From 080edf99567d2b51aebaa73d2ee976a3b74521ed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 18:29:58 +0000 Subject: [PATCH 2/2] Fix GHCR build workflow to fail on errors - Remove interactive shell exec from Dockerfile test script - Add explicit error handling with set -e in workflow - Add explicit exit code checks for docker run commands - Improve error messages when tests fail Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- .github/workflows/docker-publish.yml | 13 +++++++++++-- Dockerfile | 1 - 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1cf9e34..9fc4df3 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -68,6 +68,7 @@ jobs: - name: Test Docker image run: | + set -e # Exit immediately if a command exits with a non-zero status echo "Testing SparkOS Docker image..." # Get the first tag from the metadata output IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1) @@ -80,10 +81,18 @@ jobs: fi # Run the container and check output - docker run --rm "$IMAGE_TAG" + echo "Running container entrypoint test..." + if ! docker run --rm "$IMAGE_TAG"; then + echo "ERROR: Container entrypoint test failed!" + exit 1 + fi # Verify init binary exists and is executable - docker run --rm "$IMAGE_TAG" sh -c "test -x /sparkos/rootfs/sbin/init && echo 'Init binary is executable'" + echo "Verifying init binary is executable..." + if ! docker run --rm "$IMAGE_TAG" sh -c "test -x /sparkos/rootfs/sbin/init && echo 'Init binary is executable'"; then + echo "ERROR: Init binary verification failed!" + exit 1 + fi echo "Docker image test completed successfully!" diff --git a/Dockerfile b/Dockerfile index dfc6c47..dbdf25f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,7 +90,6 @@ echo "" echo "To test the init system:" echo " docker run --rm /sparkos/rootfs/sbin/init --help" echo "" -exec /bin/sh EOF RUN chmod +x /sparkos/test.sh