From 421006e90b4e4c513430b44923d7910bb538d28f Mon Sep 17 00:00:00 2001 From: Tobias Kaupat Date: Sun, 18 Oct 2026 10:39:18 +0200 Subject: [PATCH] test: copy the structure config into the tool container instead of bind mounting Works with a remote DOCKER_HOST as well. Co-Authored-By: Claude Sonnet 5.5 --- test/run.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/run.sh b/test/run.sh index e1b934c..a878ccd 100644 --- a/test/run.sh +++ b/test/run.sh @@ -134,11 +134,18 @@ run_structure() { # Not installed locally: fall back to the official image. It needs the # docker socket because it inspects and runs the image under test. echo "container-structure-test not installed, using the official image" - docker run --rm \ + # The config file is copied in with `docker cp` instead of bind mounted, + # so this also works when DOCKER_HOST points at a remote daemon. + local tool_cid tool_rc + tool_cid="$(docker create \ -v //var/run/docker.sock:/var/run/docker.sock \ - -v "$(host_path "${SCRIPT_DIR}")":/test \ "$STRUCTURE_TEST_IMAGE" \ - test --image "$IMAGE" --config /test/structure.yml || rc=1 + test --image "$IMAGE" --config /structure.yml)" || { rc=1; return; } + docker cp "$(host_path "${SCRIPT_DIR}")/structure.yml" "${tool_cid}:/structure.yml" \ + && docker start -a "$tool_cid" + tool_rc=$? + docker rm -f "$tool_cid" >/dev/null 2>&1 || true + [ "$tool_rc" -eq 0 ] || rc=1 fi }