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.
- Loading branch information
Showing
22 changed files
with
1,572 additions
and
21 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
name: Build & test multi-arch | ||
|
||
on: | ||
# push: | ||
# branches: | ||
# - multi-arch-tests | ||
# - qemu-user-static | ||
# pull_request: | ||
# branches: | ||
# - trunk | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-test-multi-arch: | ||
# Skip job based on the commit message, only works in push to branches for now | ||
if: contains(toJson(github.event.commits), '[skip ci]') == false | ||
name: Build & test multi-arch | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
use-random-user: [false, true] | ||
arch: [amd64, arm64] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Output Docker info | ||
run: docker info | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Get branch name (only for push to branch) | ||
if: github.event_name == 'push' | ||
run: echo "BRANCH=$(echo ${PUSH_BRANCH##*/})" >> $GITHUB_ENV | ||
env: | ||
PUSH_BRANCH: ${{ github.ref }} | ||
- name: Get target branch name (only for PRs) | ||
if: github.event_name == 'pull_request' | ||
run: echo "BRANCH=$(echo ${TARGET_BRANCH##*/})" >> $GITHUB_ENV | ||
env: | ||
TARGET_BRANCH: ${{ github.head_ref }} | ||
- name: Output branch name | ||
run: echo ${BRANCH} | ||
- name: Sets build date | ||
run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV | ||
- name: Build Docker images | ||
run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} ARCH=${ARCH} make build_multi | ||
if: matrix.arch == 'arm64' && matrix.use-random-user == 'false' | ||
- name: Test Docker images | ||
run: | | ||
docker run -d --platform linux/${ARCH} --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-firefox:${BRANCH}-${BUILD_DATE} | ||
USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} ARCH=${ARCH} SKIP_BUILD=true make test_firefox_standalone_multi | ||
#USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} ARCH=${ARCH} SKIP_BUILD=true make test_chromium_standalone_multi | ||
env: | ||
USE_RANDOM_USER: ${{ matrix.use-random-user }} | ||
ARCH: ${{ matrix.arch }} | ||
if: matrix.arch == 'arm64' && matrix.use-random-user == 'false' | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:jammy-20240405 | ||
FROM debian:bookworm | ||
LABEL authors="Selenium <[email protected]>" | ||
|
||
# Arguments to define the version of dependencies to download | ||
|
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,47 @@ | ||
ARG NAMESPACE | ||
ARG VERSION | ||
ARG AUTHORS | ||
FROM ${NAMESPACE}/node-base:${VERSION} | ||
LABEL authors=${AUTHORS} | ||
|
||
USER root | ||
|
||
#ENV LANGUAGE=en_US.UTF-8 | ||
#ENV LC_ALL=en_US.UTF-8 | ||
#ENV LANG=en_US.UTF-8 | ||
|
||
# Deal with the usr merge issues in Debian | ||
#RUN apt install usrmerge | ||
|
||
# Install Chromium | ||
# RUN echo "deb http://http.us.debian.org/debian/ stable non-free contrib main" >> /etc/apt/sources.list \ | ||
RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \ | ||
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 \ | ||
&& 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 \ | ||
# && apt-get -qqy install chromium=97.0.4692.71-0.1 \ | ||
# && apt-get -qqy install chromium=98.0.4758.102-1+b1 \ | ||
&& apt-get -qqy install chromium \ | ||
&& 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 | ||
RUN chromium --version | awk '{print $2}' > /opt/selenium/browser_version | ||
RUN echo "\"goog:chromeOptions\": {\"binary\": \"/usr/bin/chromium\"}" > /opt/selenium/browser_binary_location | ||
|
||
USER 1200 | ||
|
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,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" |
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,69 @@ | ||
ARG NAMESPACE | ||
ARG VERSION | ||
ARG AUTHORS | ||
FROM ${NAMESPACE}/node-base:${VERSION} | ||
LABEL authors=${AUTHORS} | ||
|
||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
|
||
ARG GECKODRIVER_VERSION=0.34.0 | ||
|
||
USER root | ||
|
||
# Deal with the usr merge issues in Debian | ||
#RUN apt install usrmerge | ||
|
||
#========= | ||
# Firefox | ||
#========= | ||
#RUN echo "deb http://deb.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 libavcodec-extra \ | ||
# && rm -rf /var/lib/apt/lists/* /var/cache/apt/* | ||
|
||
# Pulling Firefox from Debian Snapshots so we can control which version we use as latest | ||
RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \ | ||
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 \ | ||
&& apt-get update -qqy \ | ||
&& apt-get install libavcodec-extra firefox -y \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* | ||
|
||
#============= | ||
# geckodriver | ||
#============= | ||
RUN if [ $TARGETARCH = "arm" ] && [ $TARGETVARIANT = "v7" ]; then \ | ||
export ARCH=armhf ; \ | ||
else \ | ||
export ARCH=$TARGETARCH ; \ | ||
fi ; \ | ||
if [ -z "$ARCH" ]; then \ | ||
echo "*** BUILD ERROR: \$TARGETARCH must be arm64, amd64, or arm with \$TARGETVARIANT set to v7... exiting..." ; \ | ||
exit 1 ; \ | ||
fi ; \ | ||
if [ "$ARCH" = "arm64" ]; then \ | ||
wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux-aarch64.tar.gz ; \ | ||
elif [ "$ARCH" = "armhf" ]; then \ | ||
wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/jamesmortensen/geckodriver-arm-binaries/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux-armv7l.tar.gz ; \ | ||
else \ | ||
wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz ; \ | ||
fi ; \ | ||
tar -C /tmp -zxf /tmp/geckodriver.tar.gz ; \ | ||
rm /tmp/geckodriver.tar.gz ; \ | ||
mkdir -p /opt/geckodriver-bin ; \ | ||
mv /tmp/geckodriver /opt/geckodriver-bin/geckodriver ; \ | ||
echo "Symlinking geckodriver to /usr/local/bin/geckodriver and /usr/bin/geckodriver" ; \ | ||
ln -s /opt/geckodriver-bin/geckodriver /usr/local/bin/geckodriver ; \ | ||
chmod 755 /usr/local/bin/geckodriver ; \ | ||
ln -s /opt/geckodriver-bin/geckodriver /usr/bin/geckodriver ; \ | ||
chmod 755 /usr/bin/geckodriver | ||
|
||
USER 1200 | ||
|
||
#============================================ | ||
# Dumping Browser name and version for config | ||
#============================================ | ||
RUN echo "firefox" > /opt/selenium/browser_name | ||
RUN firefox --version | awk '{print $3}' > /opt/selenium/browser_version | ||
RUN echo "\"moz:firefoxOptions\": {\"binary\": \"/usr/bin/firefox\"}" > /opt/selenium/browser_binary_location |
Oops, something went wrong.