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

Commit

Permalink
Merging from upstream v4.0.0-20211102
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmortensen committed Nov 10, 2021
2 parents 269a676 + f0fe1dc commit 8f82b00
Show file tree
Hide file tree
Showing 13 changed files with 268 additions and 14 deletions.
15 changes: 9 additions & 6 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
FROM ubuntu:focal-20210416
# FROM ubuntu:focal-20210416
#FROM ubuntu:focal-20210827
FROM debian:latest
LABEL authors="Selenium <[email protected]>"

#================================================
# Customize sources for apt-get
#================================================
RUN echo "deb http://archive.ubuntu.com/ubuntu focal main universe\n" > /etc/apt/sources.list \
&& echo "deb http://archive.ubuntu.com/ubuntu focal-updates main universe\n" >> /etc/apt/sources.list \
&& echo "deb http://security.ubuntu.com/ubuntu focal-security main universe\n" >> /etc/apt/sources.list
#RUN echo "deb http://archive.ubuntu.com/ubuntu focal main universe\n" > /etc/apt/sources.list \
# && echo "deb http://archive.ubuntu.com/ubuntu focal-updates main universe\n" >> /etc/apt/sources.list \
# && echo "deb http://security.ubuntu.com/ubuntu focal-security main universe\n" >> /etc/apt/sources.list

# No interactive frontend during docker build
ENV DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true
DEBCONF_NONINTERACTIVE_SEEN=true \
ARCH=arm64

#========================
# Miscellaneous packages
Expand All @@ -30,7 +33,7 @@ RUN apt-get -qqy update \
supervisor \
gnupg2 \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-11-openjdk-amd64/conf/security/java.security
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-11-openjdk-$ARCH/conf/security/java.security

#===================
# Timezone settings
Expand Down
4 changes: 2 additions & 2 deletions Hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/base:4.0.0-20211025
LABEL authors=SeleniumHQ
FROM local-seleniarm/base:4.0.0-20211110
LABEL authors=SeleniumHQ,sj26,jamesmortensen

USER 1200

Expand Down
8 changes: 4 additions & 4 deletions NodeBase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/base:4.0.0-20211025
LABEL authors=SeleniumHQ
FROM local-seleniarm/base:4.0.0-20211110
LABEL authors=SeleniumHQ,sj26,jamesmortensen

USER root

Expand All @@ -28,7 +28,7 @@ ENV LANG ${LANGUAGE}
# Layer size: small: ~9 MB MB (with --no-install-recommends)
RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
language-pack-en \
#language-pack-en \
tzdata \
locales \
&& locale-gen ${LANGUAGE} \
Expand Down Expand Up @@ -84,7 +84,7 @@ RUN apt-get -qqy update \
fonts-ipafont-gothic \
fonts-wqy-zenhei \
fonts-tlwg-loma-otf \
ttf-ubuntu-font-family \
# ttf-ubuntu-font-family \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -qyy clean

Expand Down
4 changes: 2 additions & 2 deletions NodeBase/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ENV LANG ${LANGUAGE}
# Layer size: small: ~9 MB MB (with --no-install-recommends)
RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
language-pack-en \
#language-pack-en \
tzdata \
locales \
&& locale-gen ${LANGUAGE} \
Expand Down Expand Up @@ -77,7 +77,7 @@ RUN apt-get -qqy update \
fonts-ipafont-gothic \
fonts-wqy-zenhei \
fonts-tlwg-loma-otf \
ttf-ubuntu-font-family \
# ttf-ubuntu-font-family \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -qyy clean

Expand Down
35 changes: 35 additions & 0 deletions NodeChromium/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM local-seleniarm/node-base:4.0.0-20211110
LABEL authors=SeleniumHQ,sj26,jamesmortensen

USER root

# Install Chromium Arm64
# RUN echo "deb http://http.us.debian.org/debian/ stable non-free contrib main" >> /etc/apt/sources.list \
RUN echo "deb http://ftp.hk.debian.org/debian/ sid main" >> /etc/apt/sources.list \
&& apt-get update -qqy \
# && 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 \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#=================================
# Chromium Launch Script Wrapper
#=================================
COPY wrap_chromium_binary /opt/bin/wrap_chromium_binary
RUN /opt/bin/wrap_chromium_binary

#============================================
# Chromium webdriver
#============================================
RUN apt-get update -qqy \
&& apt-get -qqy install chromium-driver \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

RUN echo "chrome" > /opt/selenium/browser_name

USER 1200

28 changes: 28 additions & 0 deletions NodeChromium/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
USER root

# Install Chromium Arm64
# RUN echo "deb http://http.us.debian.org/debian/ stable non-free contrib main" >> /etc/apt/sources.list \
RUN echo "deb http://ftp.hk.debian.org/debian/ sid main" >> /etc/apt/sources.list \
&& apt-get update -qqy \
# && 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 \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#=================================
# Chromium Launch Script Wrapper
#=================================
COPY wrap_chromium_binary /opt/bin/wrap_chromium_binary
RUN /opt/bin/wrap_chromium_binary

#============================================
# Chromium webdriver
#============================================
RUN apt-get update -qqy \
&& apt-get -qqy install chromium-driver \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

RUN echo "chrome" > /opt/selenium/browser_name

USER 1200

38 changes: 38 additions & 0 deletions NodeChromium/Dockerfile.ubuntubad
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM local-seleniarm/node-base:4.0.0-rc-2-prerelease-20210930
LABEL authors=james

USER root

RUN apt-get update && apt-get install curl wget \
&& curl http://ftp.cn.debian.org/debian/pool/main/c/chromium/chromium_90.0.4430.212-1_arm64.deb -o chromium.deb

RUN ls chromium.deb && apt install -f ./chromium.deb

# Install Chromium Arm64
#RUN echo "deb http://http.us.debian.org/debian/ testing non-free contrib main" >> /etc/apt/sources.list \
#RUN
# && apt-get update -qqy \
# && apt-get -qqy install chromium=89.0.4389.82-1 \
# && apt-get -qqy install chromium=94.0.4606.54 \
# && rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#=================================
# Chromium Launch Script Wrapper
#=================================
COPY wrap_chromium_binary /opt/bin/wrap_chromium_binary
RUN /opt/bin/wrap_chromium_binary

#============================================
# Chromium webdriver
#============================================
RUN apt-get update -qqy \
&& apt-get -qqy install chromium-driver \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*


USER 1200

13 changes: 13 additions & 0 deletions NodeChromium/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
VERSION=$1
NAMESPACE=$2
AUTHORS=$3

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} >> ./Dockerfile
echo LABEL authors="$AUTHORS" >> ./Dockerfile
echo "" >> ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
12 changes: 12 additions & 0 deletions NodeChromium/wrap_chromium_binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

WRAPPER_PATH=$(readlink -f /usr/bin/chromium)
BASE_PATH="$WRAPPER_PATH-base"
mv "$WRAPPER_PATH" "$BASE_PATH"

cat > "$WRAPPER_PATH" <<_EOF
#!/bin/bash
# Note: exec -a below is a bashism.
exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@"
_EOF
chmod +x "$WRAPPER_PATH"
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# Docker images for Selenium, built for Debian ARM64

At this point, I've only updated the images for Chromium 93, the latest ARM64 build for Debian ARM64.

## Only Building the Images

If you want to build the images locally, without pushing to any registry, then use the build.sh script in the root of the project directory.

The Standalone folder is the base for all Standalone${browser} images and includes a script that starts the selenium server in standalone mode.
The NodeBase folder is the base for all Node${browser} images and includes a script that starts the selenium server in node mode.

Inside build.sh are environment variables which are used to tag the built images. If changing the Selenium version, note that you must also edit the Base/Dockerfile and change which selenium-server version is downloaded via wget. The Chromium version is set in NodeChromium/Dockerfile.txt.

To build the images, run build.sh from the root directory of this repo:

```
$ sh build.sh
```

I have not pushed any images to the Docker registry. If you wish to push them to a registry, you may do so. For more information on older ARM64 Selenium images, see https://github.com/sj26/docker-selenium and https://hub.docker.com/u/seleniarm

the primary motivation for creating this fork and updating the images is so I can use the noVNC client on Selenium 4.0.0. To use noVNC, make sure you open port 7900, and visit localhost:7900 in your browser.

To start the container image, run:

```
$ docker run --rm -it -p 4444:4444 -p 5900:5900 -p 7900:7900 --shm-size 3g local-seleniarm/standalone-chromium:latest
```

Use your traditional VNC client via port 5900, and noVNC in the browser via port 7900.


----
The official documentation from seleniumHQ begins here:
----


# Docker images for the Selenium Grid Server

The project is made possible by volunteer contributors who have put in thousands of hours of their own time,
Expand Down
28 changes: 28 additions & 0 deletions StandaloneChromium/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM local-seleniarm/node-chromium:4.0.0-20211110
LABEL authors=SeleniumHQ,sj26,jamesmortensen

USER 1200

#====================================
# Scripts to run Selenium Standalone
#====================================
COPY start-selenium-standalone.sh /opt/bin/start-selenium-standalone.sh

#==============================
# Supervisor configuration file
#==============================
COPY selenium.conf /etc/supervisor/conf.d/

# Copying configuration script generator
COPY generate_config /opt/bin/generate_config

# Boolean value, maps "--relax-checks"
ENV SE_RELAX_CHECKS true

EXPOSE 4444


30 changes: 30 additions & 0 deletions build-amd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BUILD_DATE=$(date +'%Y%m%d')
VERSION=4.0.0-beta-2
CHROMIUM=91.0.4472.124
NAMESPACE=local-selenium
AUTHORS=james

cd ./Base && docker buildx build --platform linux/amd64 -t $NAMESPACE/base:$VERSION-$BUILD_DATE .
echo $PWD
cd ../Hub && sh generate.sh $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS \
&& docker buildx build --platform linux/amd64 -t $NAMESPACE/hub:$VERSION-$BUILD_DATE .

cd ../NodeBase && sh generate.sh $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS \
&& docker buildx build --platform linux/amd64 -t $NAMESPACE/node-base:$VERSION-$BUILD_DATE .
# && sed 's/chromium=.*/chromium=91.0.4472.124/' Dockerfile > Dockerfile \
cd ../NodeChromium && sh generate.sh $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS \
&& docker buildx build --platform linux/amd64 -t $NAMESPACE/node-chromium:$VERSION-$BUILD_DATE .

cd ../Standalone && sh generate.sh StandaloneChromium node-chromium $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS \
&& cd ../StandaloneChromium \
&& docker buildx build --platform linux/amd64 -t $NAMESPACE/standalone-chromium:$VERSION-$BUILD_DATE .

echo "Build node-hub, node-chromium, and standalone-chromium...\n"
echo "Tagging builds...\n"

docker tag $NAMESPACE/base:$VERSION-$BUILD_DATE $NAMESPACE/base:latest
docker tag $NAMESPACE/hub:$VERSION-$BUILD_DATE $NAMESPACE/hub:latest
docker tag $NAMESPACE/node-base:$VERSION-$BUILD_DATE $NAMESPACE/node-base:latest
docker tag $NAMESPACE/node-chromium:$VERSION-$BUILD_DATE $NAMESPACE/node-chromium:latest
docker tag $NAMESPACE/standalone-chromium:$VERSION-$BUILD_DATE $NAMESPACE/standalone-chromium:latest

30 changes: 30 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BUILD_DATE=$(date +'%Y%m%d')
VERSION=4.0.0
CHROMIUM=93.0.4577.82 # Not yet used at this time. Edit in NodeChromium/Dockerfile.txt
NAMESPACE=local-seleniarm
AUTHORS=SeleniumHQ,sj26,jamesmortensen

cd ./Base && docker buildx build --platform linux/arm64 -t $NAMESPACE/base:$VERSION-$BUILD_DATE .
echo $PWD
cd ../Hub && sh generate.sh $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS \
&& docker buildx build --platform linux/arm64 -t $NAMESPACE/hub:$VERSION-$BUILD_DATE .

cd ../NodeBase && sh generate.sh $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS \
&& docker buildx build --platform linux/arm64 -t $NAMESPACE/node-base:$VERSION-$BUILD_DATE .
# && sed 's/chromium=.*/chromium=91.0.4472.124/' Dockerfile > Dockerfile \
cd ../NodeChromium && sh generate.sh $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS \
&& docker buildx build --platform linux/arm64 -t $NAMESPACE/node-chromium:$VERSION-$BUILD_DATE .

cd ../Standalone && sh generate.sh StandaloneChromium node-chromium $VERSION-$BUILD_DATE $NAMESPACE $AUTHORS \
&& cd ../StandaloneChromium \
&& docker buildx build --platform linux/arm64 -t $NAMESPACE/standalone-chromium:$VERSION-$BUILD_DATE .

echo "Build node-hub, node-chromium, and standalone-chromium...\n"
echo "Tagging builds...\n"

docker tag $NAMESPACE/base:$VERSION-$BUILD_DATE $NAMESPACE/base:latest
docker tag $NAMESPACE/hub:$VERSION-$BUILD_DATE $NAMESPACE/hub:latest
docker tag $NAMESPACE/node-base:$VERSION-$BUILD_DATE $NAMESPACE/node-base:latest
docker tag $NAMESPACE/node-chromium:$VERSION-$BUILD_DATE $NAMESPACE/node-chromium:latest
docker tag $NAMESPACE/standalone-chromium:$VERSION-$BUILD_DATE $NAMESPACE/standalone-chromium:latest

0 comments on commit 8f82b00

Please sign in to comment.