Skip to content

Commit

Permalink
pass the docker group to the container so it can run docker tests (#9701
Browse files Browse the repository at this point in the history
)

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: jenkinsci/acceptance-test-harness#1706
  • Loading branch information
jtnord committed Sep 6, 2024
1 parent db51210 commit 15a6eee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 15a6eee

Please sign in to comment.