Description
Feature and motivation
Improving visibility of Multi-Arch Images (also known as docker-seleniarm)
We are seeking information from the community to learn how we can bring more awareness to the existence of the multiple architecture Docker container images, reduce the learning curve for those beginning to use the container images, and enable everyone to get started faster.
One idea we're considering is to move the images in the Docker Hub seleniarm namespace to the official selenium namespace.
In order to get feedback, I want to first provide more insight and transparency on how the container images are built, as well as the challenges we face in building and maintaining them. This gives us a platform for brainstorming ideas by first seeking to understand. First, let's look at the browser images supported by Selenium and Seleniarm (multi-arch). We'll also look at how we source browser binaries, the driver binaries, as well as operating systems.
Namespaces
Currently, we have two namespaces in Docker Hub:
Selenium Images - amd64/Intel only
Namespace | Image Name | Operating System | amd64 | arm64 | armv7l |
---|---|---|---|---|---|
selenium | standalone-chrome | Ubuntu 20.04.6 LTS (Focal Fossa) | ✓ | ||
selenium | node-chrome | Ubuntu 20.04.6 LTS (Focal Fossa) | ✓ | ||
selenium | standalone-firefox | Ubuntu 20.04.6 LTS (Focal Fossa) | ✓ | ||
selenium | node-firefox | Ubuntu 20.04.6 LTS (Focal Fossa) | ✓ | ||
selenium | standalone-edge | Ubuntu 20.04.6 LTS (Focal Fossa) | ✓ | ||
selenium | node-edge | Ubuntu 20.04.6 LTS (Focal Fossa) | ✓ |
Seleniarm Container Images - Multiple Architectures (amd64 / arm64 / armv7l)
Namespace | Image Name | Operating System | amd64 | arm64 | armv7l |
---|---|---|---|---|---|
seleniarm | standalone-chromium | Debian Sid (unstable) | ✓ | ✓ | ✓ |
seleniarm | node-chromium | Debian Sid (unstable) | ✓ | ✓ | ✓ |
seleniarm | standalone-firefox | Debian Sid (unstable) | ✓ | ✓ | ✓ |
seleniarm | node-firefox | Debian Sid (unstable) | ✓ | ✓ | ✓ |
seleniarm | standalone-edge | N/A | N/A | N/A | N/A |
seleniarm | node-edge | N/A | N/A | N/A | N/A |
seleniarm | standalone-chrome | N/A | N/A | N/A | N/A |
seleniarm | node-chrome | N/A | N/A | N/A | N/A |
NOTE: Google and Microsoft do not provide binaries for their browsers on ARM. Thus, we cannot provide multi-arch images for Chrome and Edge.
Browser Binaries
Let's take a moment to look at the browser binaries which are available for various architectures:
Google Chrome
Google currently does not build binaries for Chrome on Linux for ARM. Chrome is only available for Intel/x86_64 and amd64 architectures. For multi-arch images, we substitute Google Chrome with the upstream open source Chromium browser. While they share a lot of the same code and browser engine, there are slight, subtle differences in how the browsers function.
Mozilla Firefox
Although Mozilla doesn't provide official binaries for ARM on Linux, the Debian community maintains binaries for various architectures, which are available on Debian Sid (the unstable Debian). We build and maintain container images for amd64, arm64, and armv7l. Here is where binaries for Mozilla Firefox are sourced from when building container images:
Namespace | Binary Source |
---|---|
selenium | Mozilla Official Downloads |
seleniarm | Debian Sid Snapshots (community maintained) |
Chromium
Since Google does not provide binaries for ARM, and since Google Chrome is not open source (only Chromium is), the next best solution to providing a Selenium browser automation solution on ARM is to use Chromium binaries. The Debian community maintains the chromium package and keeps it up to date.
While Chromium and Google Chrome are similar and share the same browser engines, at the end of the day, they're not the same browsers. This may be fine in some use cases and problematic in others.
Browser | Binary Source |
---|---|
Google Chrome (amd64) | Google Linux Software Repositories |
Chromium (multi-arch) | Debian Sid Snapshots (community maintained) |
Edge
Currently, Microsoft does not publish binaries for ARM. Instead, open source Chromium is our next best solution.
Browser Drivers
Locating up to date browser drivers for ARM, such as chromedriver and geckodriver, is also a challenge. Up until October 2022, I maintained geckodriver binaries for arm64 until Mozilla stepped forward and took responsibility for building and supporting arm64 geckodriver binaries. At this time, I still maintain an unofficial binary for geckodriver on armv7l so that developers and testers using Raspberry Pi devices can run their Selenium Grids and run automation scripts that drive Mozilla Firefox.
Browser Driver | Binary Source |
---|---|
chromedriver (amd64) | Official Chromium project |
chromedriver (amd64/arm64/armv7l) | Debian Sid Snapshots (community maintained) |
geckodriver (amd64/arm64) | Mozilla Releases |
geckodriver (armv7l) | geckodriver-arm-binaries unofficial binaries |
Operating Systems
Let's also look at how the base image for docker-selenium and docker-seleniarm images differ. Selenium images are built on top of a stable Ubuntu 20.04 base image, while Seleniarm images are built on Debian Sid. Debian Sid is the unstable version of the Debian operating system. It's one of the only distributions I could find that offered both of the latest binaries.
NOTE: I may revisit this. I discovered that Chromium appears to be frozen at v85 on Ubuntu and that the latest is actually installed. They have opened a bug report to rectify this misleading information.
Although Ubuntu is based on Debian, these are different distributions of Linux. Moreover, Debian Sid is considered to be on the bleeding edge while Ubuntu 20.04 is a LTS (long term stable release) and is of course quite stable.
All of this information leads us into the next question: How do we name the images so that it's clear which flavor of the container images you're using?
How the Docker Images are used
Currently, I suggest teams who exclusively use Intel based machines use images from the "selenium" namespace due to the stability of the container images. For teams using ARM hardware, the best choice is to use images from the "seleniarm" namespace.
But one question that occasionally pops up is how teams should handle scenarios where half the team uses Intel machines and the other half uses ARM? There are two ways I've seen teams handle this:
Everyone uses seleniarm
Since the docker-seleniarm images are also compatible with Intel machines, some teams choose to have everyone use the seleniarm images. The advantage is that this ensures a single docker-compose.yml file works on all architectures. However, one potential disadvantage is it also means no one is automating Google Chrome, only Chromium. Maybe that's okay, and maybe it's not. It depends.
Intel users use selenium, M1/ARM users use seleniarm
The other option I've suggested is to detect the architecture of the machine and then load the best image for that architecture. Here's an example I've taken from an article I wrote on combining multi-arch Docker images from different sources:
// if OS is not Apple M1, then assume Intel and use selenium; otherwise, use seleniarm.
const image = !os.cpus()[0].model.includes('Apple M1')
? 'selenium/standalone-chrome:latest'
: 'seleniarm/standalone-chromium:latest');
If the developer or tester uses an Intel machine, they'll pull selenium/standalone-chrome, with Ubuntu, Google Chrome, and stability. If they're using an M1, then they'll pull seleniarm/standalone-chromium, which includes Debian Sid, open source Chromium, and may involve some instability.
Moving Seleniarm to Selenium
To move Seleniarm container images to Selenium, there's a few things we need to take into consideration:
- The image names, standalone-firefox and node-firefox, are the same for both namespaces. We would either need to use different names, or there would be scenarios where one release is a mutli-arch release on Debian and another release is an amd64 release on Ubuntu.
- standalone-chome, node-chrome, and standalone-chromium and node-chromium would still be amd64-only and multi-arch respectively.
- The beta and dev tags would still reflect amd64-only, since Chromium and Mozilla do not have beta or dev channels for ARM.
- The Selenium container images are built using GitHub Actions, while the multi-arch Seleniarm images are built on CircleCI, using both arm64 and amd64 runners. The maintenance is still likely to be the same when it comes to syncing the community docker-seleniarm repo with the upstream repo (this repo).
We'd like to get feedback from the community to brainstorm some ideas for what to do. Please comment below with any suggestions on how we can proceed forward.
Usage example
The problem we're looking to solve is to make it easier to maintain multi-arch images as well as easy for the community to find and use them.