Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Commit 808a875

Browse files
Renamed NodeFirefox/Dockerfile.arm64 to NodeFirefox/Dockerfile.multi-arch to reflect the nature of building for multiple architectures, not just arm64. Updated Makefile with new Dockerfile,multi-arch name. Removed obsolete generation and build scripts, outdated experimental Ubuntu Dockerfile, and updated documentation to move how to start containers towards the top.
1 parent 790331e commit 808a875

File tree

7 files changed

+34
-156
lines changed

7 files changed

+34
-156
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ chromium_multi: node_base_multi
155155
cd ./NodeChromium && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-chromium:$(TAG_VERSION) .
156156

157157
firefox_multi: node_base_multi
158-
cd ./NodeFirefox && docker buildx build -f Dockerfile.arm64 --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) .
158+
cd ./NodeFirefox && docker buildx build -f Dockerfile.multi-arch --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) .
159159

160160
standalone_firefox_multi: firefox_multi
161161
cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) .

NodeChromium/Dockerfile.ubuntubad

Lines changed: 0 additions & 38 deletions
This file was deleted.

NodeChromium/generate.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.
File renamed without changes.

NodeFirefox/README.md

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,28 @@
1-
## Building NodeFirefox and StandaloneFirefox for ARM64
1+
## Building Multi-arch NodeFirefox and StandaloneFirefox
22

3-
I haven't located a geckdriver binary for Debian, so we'll build it from source. Unfortunately, the build step cannot yet be automated. Trying to run it as part of a docker build or even using docker exec causes the build to fail for reasons unknown to me.
3+
There are two Dockerfiles in NodeFirefox. `Dockerfile` is from the upstream repository for building the standard, official amd64 images. To build `seleniarm/node-firefox` for arm64 or armv7l (or possibly amd64 as well), we use the `Dockerfile.multi-arch` file.
44

5-
As a result, I split the build process into various steps:
5+
The easiest way to build the image is to use `make`. See examples below:
66

7-
### Step 0
87

9-
Make sure the local-seleniarm/base:latest and local-seleniarm/node-base:latest have been built using the command that builds all of the other images. If you haven't yet done this, run this from the root of the repository.
8+
**To build node/firefox for arm64:**
109

1110
```
12-
$ sh build.sh
11+
$ NAME=local-seleniarm VERSION=4.5.0 BUILD_DATE=$(date '+%Y%m%d') PLATFORMS=linux/arm64 BUILD_ARGS=--load make firefox_multi
1312
```
1413

15-
Before proceeding, verify that local-seleniarm/base:latest and local-seleniarm/node-base:latest exist by using `docker image ls`.
14+
**To build standalone/firefox for arm64:**
1615

17-
18-
### Step 1
19-
20-
In Step 1, we'll build the geckodriver. The geckodriver must be built specifically for Debian and specifically for the ARM64 platform, and we'll use an intermediate, throwaway Debian container to automatically setup the build environment by installing all of the needed dependencies. Once the build environment is setup, we'll need to manually run the compile step. To start this process, run the following command from the NodeFirefox working directory:
21-
22-
```
23-
$ cd NodeFirefox
24-
$ sh build-step-1.sh # This installs dependencies and drops you into a container bash shell
25-
```
26-
27-
Once the dependencies are installed, we'll automatically drop into the container's shell in the `/opt/geckodriver` directory. At this stage, run this command:
28-
29-
```
30-
$ sh build-geckodriver-arm64.sh
3116
```
32-
33-
This uses Rust and cargo to build geckodriver. Afterwards, the script copies the binary to `/media/share` on the host. The script then moves it to the NodeFirefox directory where it will be copied into the NodeFirefox image in the next step. Once built, exit the container:
34-
17+
$ NAME=local-seleniarm VERSION=4.5.0 BUILD_DATE=$(date '+%Y%m%d') PLATFORMS=linux/arm64 BUILD_ARGS=--load make standalone_firefox_multi
3518
```
36-
$ exit
37-
```
38-
39-
Before proceeding to the next step, verify the geckodriver binary is inside the NodeFirefox folder.
40-
41-
42-
### Step 2
43-
44-
At this stage, we're ready to build both NodeFirefox and StandaloneFirefox. To build these images, run the following command:
45-
46-
```
47-
$ sh build-step-2.sh
48-
```
49-
50-
After this completes, we see all of the container images, both with the latest tag and today's date, using `docker image ls`.
5119

20+
NOTE: Replace PLATFORMS environment variable with `linux/arm/v7` for armv7l/armhf, or `linux/amd64` for amd64.
5221

53-
## Running the StandaloneFirefox image
22+
## Running the standalone image
5423

5524
```
56-
$ docker run --rm -it --shm-size 3g -p 4444:4444 -p 5900:5900 -p 7900:7900 local-seleniarm/standalone-firefox:latest
25+
$ docker run --rm -it --shm-size 2g -p 4444:4444 -p 5900:5900 -p 7900:7900 local-seleniarm/standalone-firefox:latest
5726
```
5827

5928
As with the x86_64 images from upstream, this also includes noVNC on port 7900, which we can access via http://localhost:7900

NodeFirefox/build-and-deploy-firefox-multi-arch.sh

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,28 @@ This is a fork of [SeleniumHQ/docker-selenium](https://github.com/SeleniumHQ/doc
66

77
NOTE: If you only need the Intel/amd64 images, please see the official upstream [SeleniumHQ/docker-selenium](https://github.com/SeleniumHQ/docker-selenium) repository for best results.
88

9-
These multi-arch Seleniarm container images are available on [Docker Hub](https://hub.docker.com/u/seleniarm):
9+
## Running the ARM Container Images
10+
11+
The primary motivation for creating this fork and updating the images was so I can use the noVNC client on the latest Selenium versions on the Mac M1, an arm64 architecture. To use noVNC, make sure you open port 7900, and visit localhost:7900 in your browser.
12+
13+
The images are also successfully tested on AWS graviton nodes, resulting in better price-performance ratio and lower carbon footprint.
14+
15+
To start the standalone container images, run:
16+
17+
![Chromium](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chromium/chromium_24x24.png) Chromium
18+
```
19+
$ docker run --rm -it -p 4444:4444 -p 5900:5900 -p 7900:7900 --shm-size 2g seleniarm/standalone-chromium:latest
20+
```
21+
> NOTE: Google does not build Chrome for Linux ARM platforms. Instead, docker-seleniarm uses the open source Chromium browser instead, which _is_ built for ARM.
22+
23+
![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_24x24.png) Firefox
24+
```
25+
$ docker run --rm -it -p 4444:4444 -p 5900:5900 -p 7900:7900 --shm-size 2g seleniarm/standalone-firefox:latest
26+
```
27+
28+
Use your traditional VNC client via port 5900, and noVNC in the browser via port 7900.
29+
30+
The following multi-arch Seleniarm container images are available on [Docker Hub](https://hub.docker.com/u/seleniarm):
1031

1132
- [Standalone Chromium](https://hub.docker.com/r/seleniarm/standalone-chromium)
1233
- [Standalone Firefox](https://hub.docker.com/r/seleniarm/standalone-firefox)
@@ -16,6 +37,7 @@ These multi-arch Seleniarm container images are available on [Docker Hub](https:
1637

1738
The other upstream images are not yet supported for multi-arch, but you can try and build them yourself.
1839

40+
> NOTE: Google does not build Chrome for ARM. Instead, we use Chromium ARM.
1941
2042
## Building the ARM Images
2143

@@ -55,21 +77,6 @@ To build for armv7l/armhf, replace PLATFORMS environment variable with `linux/ar
5577
$ NAME=local-seleniarm VERSION=4.5.0 BUILD_DATE=$(date '+%Y%m%d') PLATFORMS=linux/arm/v7 BUILD_ARGS=--load make standalone_chromium_multi
5678
```
5779

58-
## Running the ARM Container Images
59-
60-
The primary motivation for creating this fork and updating the images was so I can use the noVNC client on the latest Selenium versions on the Mac M1, an arm64 architecture. To use noVNC, make sure you open port 7900, and visit localhost:7900 in your browser.
61-
62-
The images are also successfully tested on AWS graviton nodes, resulting in better price-performance ratio and lower carbon footprint.
63-
64-
To start the container image, run:
65-
66-
```
67-
$ docker run --rm -it -p 4444:4444 -p 5900:5900 -p 7900:7900 --shm-size 2g seleniarm/standalone-chromium:latest
68-
```
69-
70-
Use your traditional VNC client via port 5900, and noVNC in the browser via port 7900.
71-
72-
7380
----
7481
# -- The official documentation from seleniumHQ begins here --
7582
----

0 commit comments

Comments
 (0)