This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
forked from SeleniumHQ/docker-selenium
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed Debian mirrors to Hong Kong. Added browser version to NodeFir…
…efox Dockerfile. Added shell variables for build-step-2.sh. Fixed echo statements to print the VERSION and BUILD_DATE. Added README file in NodeFirefox with build instructions. Added generate.sh script to build-step-2.sh and used Dockerfile.arm64 as the source.
- Loading branch information
1 parent
d62f6cf
commit 547a95d
Showing
7 changed files
with
120 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
## Building NodeFirefox and StandaloneFirefox for ARM64 | ||
|
||
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. | ||
|
||
As a result, I split the build process into various steps: | ||
|
||
### Step 0 | ||
|
||
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. | ||
|
||
``` | ||
$ sh build.sh | ||
``` | ||
|
||
Before proceeding, verify that local-seleniarm/base:latest and local-seleniarm/node-base:latest exist by using `docker image ls`. | ||
|
||
|
||
### Step 1 | ||
|
||
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: | ||
|
||
``` | ||
$ cd NodeFirefox | ||
$ sh build-step-1.sh # This installs dependencies and drops you into a container bash shell | ||
``` | ||
|
||
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: | ||
|
||
``` | ||
$ sh build-geckodriver-arm64.sh | ||
``` | ||
|
||
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: | ||
|
||
``` | ||
$ exit | ||
``` | ||
|
||
Before proceeding to the next step, verify the geckodriver binary is inside the NodeFirefox folder. | ||
|
||
|
||
### Step 2 | ||
|
||
At this stage, we're ready to build both NodeFirefox and StandaloneFirefox. To build these images, run the following command: | ||
|
||
``` | ||
$ sh build-step-2.sh | ||
``` | ||
|
||
After this completes, we see all of the container images, both with the latest tag and today's date, using `docker image ls`. | ||
|
||
|
||
## Running the StandaloneFirefox image | ||
|
||
``` | ||
$ docker run --rm -it --shm-size 3g -p 4444:4444 -p 5900:5900 -p 7900:7900 local-seleniarm/standalone-firefox:latest | ||
``` | ||
|
||
As with the x86_64 images from upstream, this also includes noVNC on port 7900, which we can access via http://localhost:7900 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This script retags all of the latest images with the current date tag, in case we want to rebuild images | ||
# without rebuilding from scratch. | ||
|
||
BUILD_DATE=$(date +'%Y%m%d') | ||
VERSION=4.0.0 | ||
NAMESPACE=local-seleniarm | ||
|
||
docker tag $NAMESPACE/base:latest $NAMESPACE/base:$VERSION-$BUILD_DATE | ||
docker tag $NAMESPACE/hub:latest $NAMESPACE/hub:$VERSION-$BUILD_DATE | ||
docker tag $NAMESPACE/node-base:latest $NAMESPACE/node-base:$VERSION-$BUILD_DATE | ||
docker tag $NAMESPACE/node-chromium:latest $NAMESPACE/node-chromium:$VERSION-$BUILD_DATE | ||
docker tag $NAMESPACE/standalone-chromium:latest $NAMESPACE/standalone-chromium:$VERSION-$BUILD_DATE | ||
|
||
docker tag $NAMESPACE/node-firefox:latest $NAMESPACE/node-firefox:$VERSION-$BUILD_DATE | ||
docker tag $NAMESPACE/standalone-firefox:latest $NAMESPACE/standalone-firefox:$VERSION-$BUILD_DATE |