Skip to content

Commit a4f170e

Browse files
authored
Docker: Firefox Dev/Beta build multi arch and ChromeForTesting backward versions (#3015)
1 parent 1866f17 commit a4f170e

File tree

7 files changed

+95
-16
lines changed

7 files changed

+95
-16
lines changed

.github/workflows/update-dev-beta-browser-images.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,36 @@ jobs:
3232
include:
3333
- browser: chrome
3434
channel: dev
35+
platforms: linux/amd64
3536
- browser: chrome
3637
channel: beta
38+
platforms: linux/amd64
3739
- browser: firefox
3840
channel: dev
41+
platforms: linux/amd64,linux/arm64
3942
- browser: firefox
4043
channel: beta
44+
platforms: linux/amd64,linux/arm64
4145
- browser: edge
4246
channel: dev
47+
platforms: linux/amd64
4348
- browser: edge
4449
channel: beta
50+
platforms: linux/amd64
4551
- browser: chrome-for-testing
4652
channel: dev
53+
platforms: linux/amd64
4754
- browser: chrome-for-testing
4855
channel: beta
56+
platforms: linux/amd64
4957
- browser: chrome-for-testing
5058
channel: canary
59+
platforms: linux/amd64
5160
env:
5261
NAME: ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
5362
BROWSER: ${{ matrix.browser }}
5463
CHANNEL: ${{ matrix.channel }}
64+
PLATFORMS: ${{ matrix.platforms }}
5565

5666
steps:
5767
- name: Checkout code
@@ -91,8 +101,8 @@ jobs:
91101
92102
- name: Build the Dev/Beta Docker container images
93103
run: |
94-
echo VERSION=$SELENIUM_VERSION make "$BROWSER"_"$CHANNEL" standalone_"$BROWSER"_"$CHANNEL"
95-
VERSION=$SELENIUM_VERSION make "$BROWSER"_"$CHANNEL" standalone_"$BROWSER"_"$CHANNEL"
104+
echo VERSION=$SELENIUM_VERSION PLATFORMS=$PLATFORMS make "$BROWSER"_"$CHANNEL" standalone_"$BROWSER"_"$CHANNEL"
105+
VERSION=$SELENIUM_VERSION PLATFORMS=$PLATFORMS make "$BROWSER"_"$CHANNEL" standalone_"$BROWSER"_"$CHANNEL"
96106
97107
- name: Test the Dev/Beta Docker container images
98108
run: |

NodeChrome/install-chrome-for-testing.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ if [ -f "${INSTALL_DIR}/deb.deps" ]; then
8181
sed 's/libasound2\b/libasound2t64/g')
8282
echo "Dependencies: ${DEPS}"
8383
apt-get install -qqy --no-install-recommends ${DEPS}
84+
else
85+
apt-get install -qqy --no-install-recommends ca-certificates fonts-liberation libasound2t64 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libc6 libcairo2 libcups2 libcurl3-gnutls libdbus-1-3 libdrm2 libexpat1 libgbm1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libvulkan1 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 wget xdg-utils
8486
fi
8587

8688
# Cleanup

NodeFirefox/Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ ARG FIREFOX_LANG_VERSION=${FIREFOX_VERSION}
2323
RUN apt-get update -qqy && \
2424
FIREFOX_MAJOR_VERSION=${FIREFOX_VERSION%%.*} && \
2525
ARCH=$(if [ "$(dpkg --print-architecture)" = "amd64" ]; then echo "x86_64"; else echo "aarch64"; fi) && \
26-
if [ "$(dpkg --print-architecture)" = "amd64" ] || [ $FIREFOX_VERSION = "latest" ] || [ "${FIREFOX_MAJOR_VERSION}" -ge 136 ]; then \
26+
# Check if FIREFOX_MAJOR_VERSION is numeric before comparison \
27+
case "$FIREFOX_MAJOR_VERSION" in \
28+
''|*[!0-9]*) IS_NUMERIC=false ;; \
29+
*) IS_NUMERIC=true ;; \
30+
esac && \
31+
if [ "$(dpkg --print-architecture)" = "amd64" ] || [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERSION = "beta-latest" ] || [ $FIREFOX_VERSION = "nightly-latest" ] || [ $FIREFOX_VERSION = "devedition-latest" ] || [ $FIREFOX_VERSION = "esr-latest" ] || { [ "$IS_NUMERIC" = "true" ] && [ "${FIREFOX_MAJOR_VERSION}" -ge 136 ]; }; then \
2732
if [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERSION = "beta-latest" ] || [ $FIREFOX_VERSION = "nightly-latest" ] || [ $FIREFOX_VERSION = "devedition-latest" ] || [ $FIREFOX_VERSION = "esr-latest" ]; then \
2833
/opt/bin/install-firefox-apt.sh \
2934
&& FIREFOX_VERSION=$(echo "-$FIREFOX_VERSION" | sed 's/-latest//') \
@@ -39,13 +44,12 @@ RUN apt-get update -qqy && \
3944
fi ; \
4045
fi \
4146
else \
42-
if [ ${FIREFOX_VERSION} = "latest" ] && [ ${FIREFOX_DOWNLOAD_URL} = "" ]; then \
43-
FIREFOX_VERSION="nightly-latest" ; \
47+
if [ ${FIREFOX_VERSION} = "latest" ] || [ ${FIREFOX_VERSION} = "beta-latest" ] || [ ${FIREFOX_VERSION} = "nightly-latest" ] || [ ${FIREFOX_VERSION} = "devedition-latest" ] || [ ${FIREFOX_VERSION} = "esr-latest" ] && [ ${FIREFOX_DOWNLOAD_URL} = "" ]; then \
4448
/opt/bin/install-firefox-apt.sh \
4549
&& FIREFOX_VERSION=$(echo "-$FIREFOX_VERSION" | sed 's/-latest//') \
4650
&& apt install -y firefox$FIREFOX_VERSION \
4751
&& INSTALL_VIA_APT=true \
48-
&& if [ $FIREFOX_VERSION = "-nightly" ]; then \
52+
&& if [ $FIREFOX_VERSION = "-beta" ] || [ $FIREFOX_VERSION = "-nightly" ] || [ $FIREFOX_VERSION = "-devedition" ] || [ $FIREFOX_VERSION = "-esr" ]; then \
4953
ln -fs $(which firefox$FIREFOX_VERSION) /usr/bin/firefox ; \
5054
fi ; \
5155
else \
@@ -57,7 +61,7 @@ RUN apt-get update -qqy && \
5761
if [ "${INSTALL_VIA_APT}" != "true" ]; then \
5862
/opt/bin/install-firefox-package.sh "${FIREFOX_DOWNLOAD_URL}" "${FIREFOX_VERSION}" ; \
5963
fi \
60-
# Download the language pack for Firefox
64+
# Download the language pack for Firefox \
6165
&& /opt/bin/get_lang_package.sh ${FIREFOX_LANG_VERSION} \
6266
# Do one more upgrade to fix possible CVEs from Firefox dependencies
6367
&& apt-get update -qqy \

README.md

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ From image tag based `4.21.0` onwards, the architectures supported by this proje
155155

156156
The following browsers are available in multi-arch images:
157157

158-
| Architecture | Chrome | Chromium | Firefox | Edge |
159-
|:-------------------------:|:------:|:--------:|:-------:|:----:|
160-
| x86_64 (aka amd64) |||||
161-
| aarch64 (aka arm64/armv8) |||||
162-
| armhf (aka arm32/armv7l) |||||
158+
| Architecture | Chrome | Chromium | Firefox | Edge | CfT |
159+
|:-------------------------:|:------:|:--------:|:-------:|:----:|-----|
160+
| x86_64 (aka amd64) ||||||
161+
| aarch64 (aka arm64/armv8) ||||||
162+
| armhf (aka arm32/armv7l) ||||||
163163

164164
Note:
165165

@@ -168,6 +168,8 @@ Note:
168168
- Google does not build Chrome (`google-chrome`) for Linux/ARM platforms. Hence, the Chrome (node and standalone) images are only available for AMD64.
169169
Similarly, Microsoft does not build Edge (`microsoft-edge`) for Linux/ARM platforms.
170170

171+
- We also supply Chrome for Testing (CfT), but it is only available for Linux/AMD64.
172+
171173
- For Linux/ARM use the open source Chromium browser. The Chromium (node and standalone) images are available in multi-arch.
172174

173175
```bash
@@ -250,13 +252,13 @@ Here are the instructions to run them in Standalone mode:
250252
**Chrome Beta:**
251253

252254
```bash
253-
$ docker run --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-chrome:beta
255+
$ docker run --platform linux/amd64 --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-chrome:beta
254256
```
255257

256258
**Chrome Dev:**
257259

258260
```bash
259-
$ docker run --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-chrome:dev
261+
$ docker run --platform linux/amd64 --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-chrome:dev
260262
```
261263

262264
**Firefox Beta:**
@@ -274,13 +276,31 @@ $ docker run --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalon
274276
**Edge Beta:**
275277

276278
```bash
277-
$ docker run --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-edge:beta
279+
$ docker run --platform linux/amd64 --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-edge:beta
278280
```
279281

280282
**Edge Dev:**
281283

282284
```bash
283-
$ docker run --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-edge:dev
285+
$ docker run --platform linux/amd64 --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-edge:dev
286+
```
287+
288+
**Chrome for Testing Beta:**
289+
290+
```bash
291+
$ docker run --platform linux/amd64 --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-chrome-for-testing:beta
292+
```
293+
294+
**Chrome for Testing Dev:**
295+
296+
```bash
297+
$ docker run --platform linux/amd64 --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-chrome-for-testing:dev
298+
```
299+
300+
**Chrome for Testing Canary:**
301+
302+
```bash
303+
$ docker run --platform linux/amd64 --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-chrome-for-testing:canary
284304
```
285305

286306
### Dev and Beta on the Grid
@@ -293,6 +313,7 @@ $ docker run --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalon
293313
services:
294314
chrome:
295315
image: selenium/node-chrome:beta
316+
platform: linux/amd64
296317
shm_size: 2gb
297318
depends_on:
298319
- selenium-hub
@@ -301,6 +322,7 @@ services:
301322

302323
edge:
303324
image: selenium/node-edge:beta
325+
platform: linux/amd64
304326
shm_size: 2gb
305327
depends_on:
306328
- selenium-hub
@@ -315,6 +337,15 @@ services:
315337
environment:
316338
- SE_EVENT_BUS_HOST=selenium-hub
317339

340+
chrome-for-testing:
341+
image: selenium/node-chrome-for-testing:beta
342+
platform: linux/amd64
343+
shm_size: 2gb
344+
depends_on:
345+
- selenium-hub
346+
environment:
347+
- SE_EVENT_BUS_HOST=selenium-hub
348+
318349
selenium-hub:
319350
image: selenium/hub:latest
320351
container_name: selenium-hub
@@ -332,6 +363,7 @@ services:
332363
services:
333364
chrome:
334365
image: selenium/node-chrome:dev
366+
platform: linux/amd64
335367
shm_size: 2gb
336368
depends_on:
337369
- selenium-hub
@@ -340,6 +372,7 @@ services:
340372

341373
edge:
342374
image: selenium/node-edge:dev
375+
platform: linux/amd64
343376
shm_size: 2gb
344377
depends_on:
345378
- selenium-hub
@@ -354,6 +387,15 @@ services:
354387
environment:
355388
- SE_EVENT_BUS_HOST=selenium-hub
356389

390+
chrome-for-testing:
391+
image: selenium/node-chrome-for-testing:dev
392+
platform: linux/amd64
393+
shm_size: 2gb
394+
depends_on:
395+
- selenium-hub
396+
environment:
397+
- SE_EVENT_BUS_HOST=selenium-hub
398+
357399
selenium-hub:
358400
image: selenium/hub:latest
359401
container_name: selenium-hub

docker-compose-v3-beta-channel.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ services:
2828
environment:
2929
- SE_EVENT_BUS_HOST=selenium-hub
3030

31+
chrome-for-testing:
32+
image: selenium/node-chrome-for-testing:beta
33+
platform: linux/amd64
34+
shm_size: 2gb
35+
depends_on:
36+
- selenium-hub
37+
environment:
38+
- SE_EVENT_BUS_HOST=selenium-hub
39+
3140
selenium-hub:
3241
image: selenium/hub:latest
3342
container_name: selenium-hub

docker-compose-v3-dev-channel.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ services:
2828
environment:
2929
- SE_EVENT_BUS_HOST=selenium-hub
3030

31+
chrome-for-testing:
32+
image: selenium/node-chrome-for-testing:dev
33+
platform: linux/amd64
34+
shm_size: 2gb
35+
depends_on:
36+
- selenium-hub
37+
environment:
38+
- SE_EVENT_BUS_HOST=selenium-hub
39+
3140
selenium-hub:
3241
image: selenium/hub:latest
3342
container_name: selenium-hub

tests/build-backward-compatible/builder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,6 @@ def recursive_merge(dict1, dict2):
6262
if browser_name == "chrome" or browser_name == "all":
6363
CHROME_VERSION = matrix["browser"][browser_version]["CHROME_VERSION"]
6464
f.write(f"CHROME_VERSION={CHROME_VERSION}")
65+
if browser_name == "chrome-for-testing" or browser_name == "all":
66+
CFT_VERSION = matrix["browser"][browser_version]["CFT_VERSION"]
67+
f.write(f"CFT_VERSION={CFT_VERSION}")

0 commit comments

Comments
 (0)