From 670a2f87168bdcafdb30391b8195903b1e4544da Mon Sep 17 00:00:00 2001
From: James <jmort253@gmail.com>
Date: Tue, 22 Feb 2022 20:47:44 +0530
Subject: [PATCH] Updated Chromium, Firefox, and Selenium to latest versions.
 Added a script to build Firefox as a multi-arch image. Chromium
 98.0.4758.102; Firefox 96.0.3; Selenium 4.1.2. Pushed to DockerHub

---
 Hub/Dockerfile                                |  2 +-
 NodeBase/Dockerfile                           |  2 +-
 NodeChromium/Dockerfile                       |  5 +-
 NodeChromium/Dockerfile.txt                   |  3 +-
 NodeFirefox/Dockerfile                        |  5 +-
 NodeFirefox/Dockerfile.arm64                  |  3 +-
 .../build-and-deploy-firefox-multi-arch.sh    | 47 +++++++++++++++++++
 NodeFirefox/build-step-2.sh                   |  4 +-
 StandaloneChromium/Dockerfile                 |  2 +-
 StandaloneFirefox/Dockerfile                  |  7 +--
 build-and-deploy-multi-arch.sh                |  2 +-
 build.sh                                      |  2 +-
 12 files changed, 65 insertions(+), 19 deletions(-)
 create mode 100644 NodeFirefox/build-and-deploy-firefox-multi-arch.sh

diff --git a/Hub/Dockerfile b/Hub/Dockerfile
index 6c926b23d..8e3c95841 100644
--- a/Hub/Dockerfile
+++ b/Hub/Dockerfile
@@ -2,7 +2,7 @@
 # NOTE: DO *NOT* EDIT THIS FILE.  IT IS GENERATED.
 # PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-FROM local-seleniarm/base:4.1.1-20220119
+FROM seleniarm/base:4.1.2-20220222
 LABEL authors=SeleniumHQ,sj26,jamesmortensen
 
 USER 1200
diff --git a/NodeBase/Dockerfile b/NodeBase/Dockerfile
index 9246be15d..152685801 100644
--- a/NodeBase/Dockerfile
+++ b/NodeBase/Dockerfile
@@ -2,7 +2,7 @@
 # NOTE: DO *NOT* EDIT THIS FILE.  IT IS GENERATED.
 # PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-FROM local-seleniarm/base:latest
+FROM seleniarm/base:4.1.2-20220222
 LABEL authors=SeleniumHQ,sj26,jamesmortensen
 
 USER root
diff --git a/NodeChromium/Dockerfile b/NodeChromium/Dockerfile
index b466ff897..14cca1dc5 100644
--- a/NodeChromium/Dockerfile
+++ b/NodeChromium/Dockerfile
@@ -2,7 +2,7 @@
 # NOTE: DO *NOT* EDIT THIS FILE.  IT IS GENERATED.
 # PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-FROM local-seleniarm/node-base:latest
+FROM seleniarm/node-base:4.1.2-20220222
 LABEL authors=SeleniumHQ,sj26,jamesmortensen
 
 USER root
@@ -14,7 +14,8 @@ RUN echo "deb http://ftp.hk.debian.org/debian/ sid main" >> /etc/apt/sources.lis
   # && apt-get -qqy install chromium=89.0.4389.82-1 \
   # && apt-get -qqy install chromium=90.0.4430.212-1 \
   # && apt-get -qqy install chromium=93.0.4577.82-1 \
-  && apt-get -qqy install chromium=97.0.4692.71-0.1 \
+  # && apt-get -qqy install chromium=97.0.4692.71-0.1 \
+  && apt-get -qqy install chromium=98.0.4758.102-1+b1 \
   && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
 
 #=================================
diff --git a/NodeChromium/Dockerfile.txt b/NodeChromium/Dockerfile.txt
index acd1c06e0..ae8d50a3d 100644
--- a/NodeChromium/Dockerfile.txt
+++ b/NodeChromium/Dockerfile.txt
@@ -7,7 +7,8 @@ RUN echo "deb http://ftp.hk.debian.org/debian/ sid main" >> /etc/apt/sources.lis
   # && apt-get -qqy install chromium=89.0.4389.82-1 \
   # && apt-get -qqy install chromium=90.0.4430.212-1 \
   # && apt-get -qqy install chromium=93.0.4577.82-1 \
-  && apt-get -qqy install chromium=97.0.4692.71-0.1 \
+  # && apt-get -qqy install chromium=97.0.4692.71-0.1 \
+  && apt-get -qqy install chromium=98.0.4758.102-1+b1 \
   && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
 
 #=================================
diff --git a/NodeFirefox/Dockerfile b/NodeFirefox/Dockerfile
index 473e027b7..d573c3018 100644
--- a/NodeFirefox/Dockerfile
+++ b/NodeFirefox/Dockerfile
@@ -2,7 +2,7 @@
 # NOTE: DO *NOT* EDIT THIS FILE.  IT IS GENERATED.
 # PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-FROM local-seleniarm/node-base:4.1.0-20211217
+FROM seleniarm/node-base:4.1.2-20220222
 LABEL authors=SeleniumHQ,sj26,jamesmortensen
 
 #FROM local-seleniarm/node-base:4.0.0-20211018
@@ -15,7 +15,8 @@ USER root
 #=========
 RUN echo "deb http://ftp.hk.debian.org/debian/ sid main" >> /etc/apt/sources.list \
   && apt-get update -qqy \
-  && apt-get -qqy install firefox-esr libavcodec-extra \
+  # && apt-get -qqy install firefox-esr libavcodec-extra \
+  && apt-get -qqy install firefox libavcodec-extra \
   && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
 
 # geckodriver was built using the local-seleniarm/geckodriver-arm64 Debian image
diff --git a/NodeFirefox/Dockerfile.arm64 b/NodeFirefox/Dockerfile.arm64
index b4a8bdb00..fc36133f0 100644
--- a/NodeFirefox/Dockerfile.arm64
+++ b/NodeFirefox/Dockerfile.arm64
@@ -8,7 +8,8 @@ USER root
 #=========
 RUN echo "deb http://ftp.hk.debian.org/debian/ sid main" >> /etc/apt/sources.list \
   && apt-get update -qqy \
-  && apt-get -qqy install firefox-esr libavcodec-extra \
+  # && apt-get -qqy install firefox-esr libavcodec-extra \
+  && apt-get -qqy install firefox libavcodec-extra \
   && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
 
 # geckodriver was built using the local-seleniarm/geckodriver-arm64 Debian image
diff --git a/NodeFirefox/build-and-deploy-firefox-multi-arch.sh b/NodeFirefox/build-and-deploy-firefox-multi-arch.sh
new file mode 100644
index 000000000..000d61717
--- /dev/null
+++ b/NodeFirefox/build-and-deploy-firefox-multi-arch.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+DOCKERDEB=false   # if using Docker Desktop, set to false
+
+
+# if [[ $DOCKERDEB == true ]]
+# then
+#     echo 'Getting geckodriver binary from the Docker Debian VM...'
+#     sh get-geckodriver.sh
+# else
+#     echo 'Getting geckodriver from /media/host...'
+#     cp /media/host/geckodriver .
+# fi
+
+echo 'Generate the Dockerfile.arm64...'
+BUILD_DATE=$(date +'%Y%m%d')
+VERSION=4.1.2
+NAMESPACE=seleniarm
+AUTHORS=SeleniumHQ,sj26,jamesmortensen
+ARCH=linux/arm64,linux/amd64,linux/arm/v7
+
+echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
+echo "# NOTE: DO *NOT* EDIT THIS FILE.  IT IS GENERATED." >> ./Dockerfile
+echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
+echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
+echo FROM ${NAMESPACE}/node-base:${VERSION}-${BUILD_DATE} >> ./Dockerfile
+echo LABEL authors="$AUTHORS" >> ./Dockerfile
+echo "" >> ./Dockerfile
+cat ./Dockerfile.arm64 >> ./Dockerfile
+
+
+
+echo "Building Seleniarm/NodeFirefox:$VERSION-$BUILD_DATE"
+docker buildx build --push --platform $ARCH -f Dockerfile -t $NAMESPACE/node-firefox:$VERSION-$BUILD_DATE .
+#docker tag $NAMESPACE/node-firefox:$VERSION-$BUILD_DATE $NAMESPACE/node-firefox:latest
+
+# Generate the Seleniarm/StandaloneFirefox Dockerfile
+cd ../Standalone && sh generate.sh StandaloneFirefox node-firefox $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS
+cd ../StandaloneFirefox
+
+echo "Building Seleniarm/StandaloneFirefox:$VERSION-$BUILD_DATE"
+docker buildx build --push --platform $ARCH -f Dockerfile -t $NAMESPACE/standalone-firefox:$VERSION-$BUILD_DATE .
+#docker tag $NAMESPACE/standalone-firefox:$VERSION-$BUILD_DATE $NAMESPACE/standalone-firefox:latest
+
+
+# Remove geckodriver image and dependencies if build is successful, since it's 4.9GB!
+# docker image rm local-seleniarm/geckodriver-arm64:$VERSION-$BUILD_DATE
diff --git a/NodeFirefox/build-step-2.sh b/NodeFirefox/build-step-2.sh
index 73250632e..d979c5494 100644
--- a/NodeFirefox/build-step-2.sh
+++ b/NodeFirefox/build-step-2.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 DOCKERDEB=false   # if using Docker Desktop, set to false
-ARCH=linux/amd64
+ARCH=linux/arm64
 
 if [[ $DOCKERDEB == true ]]
 then
@@ -14,7 +14,7 @@ fi
 
 echo 'Generate the Dockerfile.arm64...'
 BUILD_DATE=$(date +'%Y%m%d')
-VERSION=4.1.0
+VERSION=4.1.2
 NAMESPACE=local-seleniarm
 AUTHORS=SeleniumHQ,sj26,jamesmortensen
 
diff --git a/StandaloneChromium/Dockerfile b/StandaloneChromium/Dockerfile
index e4ca6e374..c92fa187b 100644
--- a/StandaloneChromium/Dockerfile
+++ b/StandaloneChromium/Dockerfile
@@ -2,7 +2,7 @@
 # NOTE: DO *NOT* EDIT THIS FILE.  IT IS GENERATED.
 # PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-FROM local-seleniarm/node-chromium:latest
+FROM seleniarm/node-chromium:4.1.2-20220222
 LABEL authors=SeleniumHQ,sj26,jamesmortensen
 
 USER 1200
diff --git a/StandaloneFirefox/Dockerfile b/StandaloneFirefox/Dockerfile
index e34e4e035..972f32117 100644
--- a/StandaloneFirefox/Dockerfile
+++ b/StandaloneFirefox/Dockerfile
@@ -2,13 +2,8 @@
 # NOTE: DO *NOT* EDIT THIS FILE.  IT IS GENERATED.
 # PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-<<<<<<< HEAD
-FROM local-seleniarm/node-firefox:4.1.0-20211217
+FROM seleniarm/node-firefox:4.1.2-20220222
 LABEL authors=SeleniumHQ,sj26,jamesmortensen
-=======
-FROM selenium/node-firefox:4.1.2-20220217
-LABEL authors=SeleniumHQ
->>>>>>> 655026371fd7958b4aec2dd551a0b9af0cc5f4b3
 
 USER 1200
 
diff --git a/build-and-deploy-multi-arch.sh b/build-and-deploy-multi-arch.sh
index 28f666d4b..921c31360 100644
--- a/build-and-deploy-multi-arch.sh
+++ b/build-and-deploy-multi-arch.sh
@@ -1,5 +1,5 @@
 BUILD_DATE=$(date +'%Y%m%d')
-VERSION=4.1.1-alpha
+VERSION=4.1.2
 CHROMIUM=93.0.4577.82  # Not yet used at this time. Edit in NodeChromium/Dockerfile.txt
 NAMESPACE=seleniarm
 AUTHORS=SeleniumHQ,sj26,jamesmortensen
diff --git a/build.sh b/build.sh
index f4884dbe0..b07958b11 100755
--- a/build.sh
+++ b/build.sh
@@ -1,7 +1,7 @@
 #!/bin/bash -x
 
 BUILD_DATE=$(date +'%Y%m%d')
-VERSION=4.1.1
+VERSION=4.1.2
 CHROMIUM=93.0.4577.82  # Not yet used at this time. Edit in NodeChromium/Dockerfile.txt
 NAMESPACE=local-seleniarm
 AUTHORS=SeleniumHQ,sj26,jamesmortensen