Make Selenium image configurable

In certain environments, we may want to customise the docker image e.g.
to use a proxy to avoid docker hub rate limiting. The default behaviour
remains unchanged.

The `if` logic was broken because `uname -a` returns the entire uname,
including OS, Kernel version, machine type and what not. The string
always starts with the OS i.e. Linux or Darwin, therefore, the matching
for `arm*` was always false; therefore, it was always defaulting to the
`else` image, which happens to be multi-arch. However, it was using
`seleniarm`, which is a community driven effort, not the official
Selenium account.

In the official OSS image, version 123.0 is too old. The oldest
available is 127.0. This commit bumps to the latest available. We could
consider depending on version `4`. Version `4` refers to Selenium
version, whilst version 123.0/133.0 refer to the browser version.

(cherry picked from commit ef8b4fc767)
This commit is contained in:
Aitor Perez 2025-02-25 13:24:07 +00:00 committed by Mergify
parent fe204b3ebf
commit dc9e7d2e76
1 changed files with 3 additions and 6 deletions

View File

@ -1,11 +1,8 @@
#!/usr/bin/env bash
arch=$(uname -a)
if [[ $arch == arm* ]]; then
SELENIUM_DOCKER_IMAGE=selenium/standalone-chrome:123.0
else
SELENIUM_DOCKER_IMAGE=seleniarm/standalone-chromium:123.0
fi
# selenium/standalone-chromium is multi-arch
# https://hub.docker.com/r/selenium/standalone-chromium/tags
SELENIUM_DOCKER_IMAGE=${SELENIUM_DOCKER_IMAGE:-selenium/standalone-chromium:133.0}
start_selenium() {
begin "Starting selenium ..."