From 6db42e5f27feb5b9ffe805a71ceb801e2b16427e Mon Sep 17 00:00:00 2001 From: James Nord Date: Fri, 6 Sep 2024 09:34:33 +0100 Subject: [PATCH] pass the docker group to the container so it can run docker tests The ATH image no longer SUIDs the docker executable but relies on permissions of the docker.sock. This was needed to allow test-containers based tests to run as this uses the socket directly rather than relying on the docker cli. cf: https://github.com/jenkinsci/acceptance-test-harness/pull/1706 --- ath.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ath.sh b/ath.sh index 28aefd42b4c4..45427edd5214 100644 --- a/ath.sh +++ b/ath.sh @@ -26,11 +26,15 @@ fi mkdir -p target/ath-reports chmod a+rwx target/ath-reports +# obtain the groupId to grant to access the docker socket to run tests needing docker +dockergid=$(docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ubuntu:noble stat -c %g /var/run/docker.sock) + exec docker run --rm \ --env JDK \ --env ATH_VERSION \ --env BROWSER \ --shm-size 2g `# avoid selenium.WebDriverException exceptions like 'Failed to decode response from marionette' and webdriver closed` \ + --group-add ${dockergid} \ --volume "$(pwd)"/war/target/jenkins.war:/jenkins.war:ro \ --volume /var/run/docker.sock:/var/run/docker.sock:rw \ --volume "$(pwd)"/target/ath-reports:/reports:rw \