Skip to content

Commit 4f4e716

Browse files
VietND96jamesmortensentriesztuixavierogdeejgregor
committed
Merging the fork [docker-seleniarm] into docker-selenium (#2257)
* add CircleCI status badge * Update README * Adding the code to add all of the browser tags and update the latest tag * 4.1.4 * Bumping grid to 4.1.4 and updating Firefox to v99.0-1 * [deploy] 4.1.4 and Firefox 99.0-1 with browser tags and update latest tag * Updated README and [deploy] grid 4.1.4 and Firefox 99.0 * Attempts to tag multi-arch images by modifying the manifest * Added the functionality to add browser versions to the Docker Hub tags. Also, updated the 'latest' tag. * Allow passing an environment variable GRID_STATUS_MAX_ATTEMPTS to override the default 3 attempts to a differen value. Useful for testing under emulation where things are slower. * Updated Firefox to 100.0.2-1 * [deploy] Firefox 100.0.2-1 and Selenium 4.2.1 * Fixing bug in variable name causing browser tagging with browser version and webdriver and selenium versions to fail. * Fixed merge conflict from earlier * [deploy] 4.2.2 seleniarm images * Automating the process of modifying the selenium grid tag since I keep forgetting to do it when deploying. * run the deploy workflow without deploying * Using instead of backticks * Cleanup config.yml * Debugging why it deployed as 4.1.0... * test [deploy] * test [deploy] and outputting some debug info * test [deploy] and outputting some debug info * test [deploy] is BRANCH a reserved keyword? * test [deploy] is BRANCH a reserved keyword? * More tests [deploy] * debug [deploy] * debug [deploy] * Clean up and [deploy] test * test [deploy] to test account to check tags * Resolved issue with BRANCH environment variable not being set properly so it can be reused from step to step. * [deploy] 4.3.0 * [deploy] 4.3.0 again since it failed * small addition to readme to confirm graviton compatibility * [deploy] 4.3.0 updates * [deploy] 4.4.0 * [deploy] update * update Firefox version * [deploy] 4.4.0 with Firefox 104.0-1 * Update Makefile * Add node and standalone docker build * Fix tabs. Also, replace hard-coded platforms with variable, since we build and test separately but then build and deploy together. * Bump Firefox to 105.0.1-1 * [deploy] Selenium 4.5.0 and Firefox 105.0.1-1 * Fix race condition when launching websockify. Summary of issue #18: noVNC's launch.sh invokes `ps`. Without it, it exits prematurely, thus ruining websockify's stdout and stderr file descriptors. Depending on how fast websockify starts up, this may or may not prevent it from working. * CircleCI: prevent '/' characters in Docker tags. This fixes #21. * [deploy] fixes for #18 and #21 * Removing obsolete and not supported shell scripts. Updating docs with the supported method for building the ARM images locally. * README.md formatting change * Removed retag-latest-images-as-today obsolete script. * 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. * Make more clear Chrome isn't build for ARM 'on Linux' * Bump geckodriver to 0.32.0. Replace jamesmortensen/geckodriver-arm-binaries with official mozilla/geckodriver repo for arm64. Fixes #22 * [deploy] with upstream changes and official Mozilla geckodriver arm64 v0.32.0 * [deploy] 4.5.2 with Java 11 HTTP client * [deploy] 4.5.3 * [deploy] merge from upstream and deploy 4.6.0 * Modified the telemetry installation commands so that the coursiers launcher pulled the binary based on arch, and only for the supported ones arm64 and x86_64 * [deploy] 4.6.0 * Update Firefox to v107 * [deploy] 4.7.0 * [deploy] 4.7.1 * Publish plain version numbers (e.g.: 4.6.0, 4.6, 4) * [deploy] using the native coursier binaries, since the JAR version takes too long and causes the build to exceed the timeout * [deploy] with jaegar observability jars only for aarch64 since it causes the deployment to timeout for other architectures. * Upgrade to Firefox 108.0-2 for all architectures * Test [deploy]. Add the grid components to the deploy step, and split up building images into different, parallel jobs to reduce build time. * Test [deploy]. Add the grid components to the deploy step, and split up building images into different, parallel jobs to reduce build time. * [deploy] fix job names * test [deploy] debug some broken build processes. * [deploy] Avoid make and run all build commands brom build-and-push.sh * [deploy] 4.7.2 with Firefox 108 * [deploy] testing using an exit code in case a command in the script fails * [deploy] * Change bash to sh * [deploy] test * [deploy] testing to see why building base behaves differently with make vs running via a script * [deploy] re-register binfmt and qemu for each runner * [deploy] testing tagging and release notes job after fixing env var dereferencing * [deploy] testing tagging and release notes job after fixing env var dereferencing * [deploy] try using one of the parameters passed in declaratively instead. * [deploy] try with the job name and also log it for the base job as well * [deploy] using the make targets parameter. * [deploy] using the make targets parameter. * [deploy] test * [deploy] test * test [deploy] Added scripts and logic to add the Major_minor tags to the non-browser images, and added logic to add all of the tags to the release notes. * Changed file permissions so shell script can be executed. * Test [deploy] Remove comment * Test [deploy] Adding NAMESPACE variable to the docker-pull-related-tags script. * Test [deploy] and retag the images with related tags instead of excessive pulling. * Test [deploy]. Rename docker-pull-related-tags to docker-add-related-tags. Clean up the names of the steps in the release notes generation step. Reorder the MAJOR, MAJOR-MINOR, and VERSION tags for the browser images so the order in Docker Hub matches their upstream siblings. Temporarily disable building images to focus on the release notes generation step. * Test [deploy] forgot a tag * Test [deploy] need to set build date to date of prev deployed images in order to test the final job * test [deploy] removed commented test code * Test [deploy] to see the full flow. * test [deploy] after merge from trunk and upstream * Test [deploy] * Test [deploy] * Fix ordering of the grid images * Change everything back to the production 'seleniarm' Docker credentials and namespace. * [deploy] 4.8.0 with upgrade Firefox to 109 and full grid. * If we're getting release notes, pull from docker anonymously * [deploy] with 0.32.1 geckodriver * [deploy] Need to be logged into Docker Hub in order to push tags but not for release notes portion. * [deploy] 4.8.0 with latest noVNC and websockify * Upgrade to Firefox 109 and geckodriver 0.32.2 * [deploy] 4.8.1 and geckodriver 0.32.2 * [deploy] with updates to use buildx imagetools instead of docker manifest to add tags to multi-arch images * [deploy] with 'chomium' typo fix. * [deploy] updates from upstream * Updated multi-arch Firefox to 111.0.1-1. * [deploy] 4.8.2 * [deploy] 4.8.2 with Firefox rollback to v109. * [deploy] 4.8.2 * [deploy] 4.8.3. Updated build-and-push.sh script to use default Selenium version from the Base/Dockerfile so environment variable is only needed if we want the tag version to be something else. * Update Firefox to v112.0-1 * [deploy] 4.9.0 * Adding some delays between building images that are dependent on each other to avoid 'failed to solve' errors * For build errors, we'll retry them 5 times before giving up * Updating the README docs to reflect the state of building the grid components. * [deploy] 4.9.1 * debian:latest is now bookworm, and openjdk-11-jre-headless is missing. So we pin to debian:bullseye * Bump Firefox to 114.0-1 and geckodriver to 0.33.0 * [deploy] Selenium 4.10, Firefox 114,0-1 geckodriver 0.33.0 * Update CircleCI config to deploy grid from trunk * Updated Firefox to 116.0-2 * Downgrade Selenium to 4.10 with updated browsers and drivers * [deploy] updated browsers with Selenium 4.10.0 * Merge from upstream to add Selenium Manager SE_OFFLINE environment variable. Upgrade to Selenium 4.11.0 * update python selenium module to latest. Update Firefox * [deploy] latest browsers for Selenium 4.10.0 * [deploy] 4.10.0 redeploy * Fix build scripts so the RELEASE variable is used. * Fix Makefile - add BASE_RELEASE and BASE_VERSION to the base_multi action * Adding locale to Chromium dockerfile. * Handle usrmerge issues https://wiki.debian.org/UsrMerge * Just install usrmerge * Try chromium without usrmerge. Upgrade Firefox to 120 * Add usrmerge to NodeChromium after setting sources. Split Firefox install into 2 runs for easier debugging * [deploy] test with debian bookworm update - was missing the browser_version and browser_binary_location from upstream. Java package openjdk no longer available in bookworm so replaced with temurin Co-authored-by: Fried Hoeben <[email protected]> * [deploy] test * [deploy] test from tmp * [deploy] fixed tests * Fixed tests by waiting for downloadable files to exist in array, fixes Chromium tests. Co-authored-by: Fried Hoeben <[email protected]> * Prepare release for 4.16.1 * [deploy] 4.16.1 * test(chart) against build multi Signed-off-by: Viet Nguyen Duc <[email protected]> * Sync update from upstream Signed-off-by: Viet Nguyen Duc <[email protected]> * Adding script used to build the multi-arch images, but locally using only one architecture. * Fixed issue where xauth not found, preventing xvfb from starting. * CI chart tests against amd64 only Signed-off-by: Viet Nguyen Duc <[email protected]> * Skip NodeChromium in Dockerfile scan Signed-off-by: Viet Nguyen Duc <[email protected]> * [deploy] v4.17.0 * [build] Update deploy workflow Signed-off-by: Viet Nguyen Duc <[email protected]> * [deploy] v4.17.0 * [deploy] v4.17.0 Signed-off-by: Viet Nguyen Duc <[email protected]> * [deploy] 4.17.0 - Fix bug in auto-retry logic where if build fails 5 times it needs to also return exit 1 to not let CI think it succeeded. * Sync with upstream * [deploy] 4.18.0 * [deploy] tag image name 4.18.0 * Release v4.18.1 [deploy] Signed-off-by: Viet Nguyen Duc <[email protected]> * [deploy] fix broken link to download Firefox v124 Update Dockerfile.multi-arch * update: Debian repo is used in NodeChromium Fixed seleniumhq-community#69 * Temporary disable arch linux/arm/v7 due to NodeFirefox build failed [deploy] Signed-off-by: Viet Nguyen Duc <[email protected]> * .circleci fetch selenium version from Makefile Signed-off-by: Viet Nguyen Duc <[email protected]> * Add back platform linux/arm/v7 This reverts commit d16ae9e. Signed-off-by: Viet Nguyen Duc <[email protected]> * Update .circleci [deploy] Signed-off-by: Viet Nguyen Duc <[email protected]> --------- Signed-off-by: Viet Nguyen Duc <[email protected]> Co-authored-by: James Mortensen <[email protected]> Co-authored-by: Peter Triesz <[email protected]> Co-authored-by: Xavier G <[email protected]> Co-authored-by: DJ Gregor <[email protected]> Co-authored-by: Fried Hoeben <[email protected]>
1 parent d6936ac commit 4f4e716

22 files changed

+1562
-23
lines changed

.circleci/config.yml

Lines changed: 405 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build & test multi-arch
2+
3+
on:
4+
# push:
5+
# branches:
6+
# - multi-arch-tests
7+
# - qemu-user-static
8+
# pull_request:
9+
# branches:
10+
# - trunk
11+
workflow_dispatch:
12+
13+
jobs:
14+
build-and-test-multi-arch:
15+
# Skip job based on the commit message, only works in push to branches for now
16+
if: contains(toJson(github.event.commits), '[skip ci]') == false
17+
name: Build & test multi-arch
18+
runs-on: ubuntu-20.04
19+
strategy:
20+
matrix:
21+
use-random-user: [false, true]
22+
arch: [amd64, arm64]
23+
fail-fast: false
24+
25+
steps:
26+
- uses: actions/checkout@v1
27+
- name: Output Docker info
28+
run: docker info
29+
- name: Set up Python 3.8
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: 3.8
33+
- name: Get branch name (only for push to branch)
34+
if: github.event_name == 'push'
35+
run: echo "BRANCH=$(echo ${PUSH_BRANCH##*/})" >> $GITHUB_ENV
36+
env:
37+
PUSH_BRANCH: ${{ github.ref }}
38+
- name: Get target branch name (only for PRs)
39+
if: github.event_name == 'pull_request'
40+
run: echo "BRANCH=$(echo ${TARGET_BRANCH##*/})" >> $GITHUB_ENV
41+
env:
42+
TARGET_BRANCH: ${{ github.head_ref }}
43+
- name: Output branch name
44+
run: echo ${BRANCH}
45+
- name: Sets build date
46+
run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
47+
- name: Build Docker images
48+
run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} ARCH=${ARCH} make build_multi
49+
if: matrix.arch == 'arm64' && matrix.use-random-user == 'false'
50+
- name: Test Docker images
51+
run: |
52+
docker run -d --platform linux/${ARCH} --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-firefox:${BRANCH}-${BUILD_DATE}
53+
USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} ARCH=${ARCH} SKIP_BUILD=true make test_firefox_standalone_multi
54+
#USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} ARCH=${ARCH} SKIP_BUILD=true make test_chromium_standalone_multi
55+
env:
56+
USE_RANDOM_USER: ${{ matrix.use-random-user }}
57+
ARCH: ${{ matrix.arch }}
58+
if: matrix.arch == 'arm64' && matrix.use-random-user == 'false'
59+

Base/Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
3636
# Miscellaneous packages
3737
# Includes minimal runtime used for executing non GUI Java programs
3838
#========================
39-
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
40-
echo "deb http://archive.ubuntu.com/ubuntu jammy main universe\n" > /etc/apt/sources.list \
41-
&& echo "deb http://archive.ubuntu.com/ubuntu jammy-updates main universe\n" >> /etc/apt/sources.list \
42-
&& echo "deb http://security.ubuntu.com/ubuntu jammy-security main universe\n" >> /etc/apt/sources.list ; \
43-
fi \
44-
&& apt-get -qqy update \
39+
RUN apt-get -qqy update \
4540
&& apt-get upgrade -yq \
4641
&& apt-get -qqy --no-install-recommends install \
4742
acl \

Makefile

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,77 @@ edge_upgrade_version:
185185
docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) microsoft-edge --version
186186
docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) msedgedriver --version
187187

188+
# Register linux/arm64 and linux/arm/v7 architectures for building with BuildKit
189+
# docker run --rm --privileged aptman/qus -s -- -p # for actions
190+
qemu_user_static:
191+
docker run --rm --privileged aptman/qus -- -r ; \
192+
docker run --rm --privileged aptman/qus -s -- -p
193+
194+
# Build multi-arch images
195+
all_multi: base_multi \
196+
hub_multi \
197+
chromium_multi \
198+
firefox_multi \
199+
docker_multi \
200+
standalone_chromium_multi \
201+
standalone_firefox_multi \
202+
standalone_docker_multi \
203+
distributor_multi \
204+
router_multi \
205+
sessions_multi \
206+
sessionqueue_multi \
207+
event_bus_multi \
208+
video_multi
209+
210+
build_multi: all_multi
211+
212+
ci_multi: build_multi test_multi_arch
213+
214+
base_multi: qemu_user_static
215+
cd ./Base && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION) --build-arg RELEASE=$(BASE_RELEASE) -t $(NAME)/base:$(TAG_VERSION) .
216+
217+
hub_multi: base_multi
218+
cd ./Hub && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/hub:$(TAG_VERSION) .
219+
220+
distributor_multi:
221+
cd ./Distributor && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/distributor:$(TAG_VERSION) .
222+
223+
router_multi:
224+
cd ./Router && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/router:$(TAG_VERSION) .
225+
226+
sessions_multi:
227+
cd ./Sessions && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/sessions:$(TAG_VERSION) .
228+
229+
sessionqueue_multi:
230+
cd ./SessionQueue && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/session-queue:$(TAG_VERSION) .
231+
232+
event_bus_multi: base_multi
233+
cd ./EventBus && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/event-bus:$(TAG_VERSION) .
234+
235+
node_base_multi: base_multi
236+
cd ./NodeBase && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-base:$(TAG_VERSION) .
237+
238+
chromium_multi: node_base_multi
239+
cd ./NodeChromium && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-chromium:$(TAG_VERSION) .
240+
241+
firefox_multi: node_base_multi
242+
cd ./NodeFirefox && docker buildx build -f Dockerfile.multi-arch --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) .
243+
244+
docker_multi: base_multi
245+
cd ./NodeDocker && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-docker:$(TAG_VERSION) .
246+
247+
standalone_firefox_multi: firefox_multi
248+
cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) .
249+
250+
standalone_chromium_multi: chromium_multi
251+
cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chromium -t $(NAME)/standalone-chromium:$(TAG_VERSION) .
252+
253+
standalone_docker_multi: docker_multi
254+
cd ./StandaloneDocker && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/standalone-docker:$(TAG_VERSION) .
255+
256+
video_multi:
257+
cd ./Video && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(FFMPEG_BASED_NAME) --build-arg BASED_TAG=$(FFMPEG_BASED_TAG) -t $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) .
258+
188259
# https://github.com/SeleniumHQ/docker-selenium/issues/992
189260
# Additional tags for browser images
190261
tag_and_push_browser_images: tag_and_push_chrome_images tag_and_push_firefox_images tag_and_push_edge_images
@@ -217,6 +288,58 @@ tag_latest:
217288
docker tag $(NAME)/standalone-docker:$(TAG_VERSION) $(NAME)/standalone-docker:latest
218289
docker tag $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) $(NAME)/video:latest
219290

291+
# Additional tags for browser images
292+
tag_and_push_multi_arch_browser_images: tag_and_push_multi_arch_chromium_images tag_and_push_multi_arch_firefox_images
293+
294+
tag_and_push_multi_arch_chromium_images:
295+
./tag_and_push_multi-arch_browser_images.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) chromium
296+
297+
tag_and_push_multi_arch_firefox_images:
298+
./tag_and_push_multi-arch_browser_images.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) firefox
299+
300+
tag_major_minor_multi_arch:
301+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) base
302+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) hub
303+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) node-base
304+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) node-docker
305+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) standalone-docker
306+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) sessions
307+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) session-queue
308+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) event-bus
309+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) router
310+
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) distributor
311+
312+
tag_multi_arch_latest:
313+
docker buildx imagetools create -t ${NAMESPACE}/base:latest ${NAMESPACE}/base:${TAG_VERSION}
314+
docker buildx imagetools create -t ${NAMESPACE}/hub:latest ${NAMESPACE}/hub:${TAG_VERSION}
315+
docker buildx imagetools create -t ${NAMESPACE}/node-base:latest ${NAMESPACE}/node-base:${TAG_VERSION}
316+
docker buildx imagetools create -t ${NAMESPACE}/node-chromium:latest ${NAMESPACE}/node-chromium:${TAG_VERSION}
317+
docker buildx imagetools create -t ${NAMESPACE}/node-firefox:latest ${NAMESPACE}/node-firefox:${TAG_VERSION}
318+
docker buildx imagetools create -t ${NAMESPACE}/standalone-chromium:latest ${NAMESPACE}/standalone-chromium:${TAG_VERSION}
319+
docker buildx imagetools create -t ${NAMESPACE}/standalone-firefox:latest ${NAMESPACE}/standalone-firefox:${TAG_VERSION}
320+
docker buildx imagetools create -t ${NAMESPACE}/node-docker:latest ${NAMESPACE}/node-docker:${TAG_VERSION}
321+
docker buildx imagetools create -t ${NAMESPACE}/standalone-docker:latest ${NAMESPACE}/standalone-docker:${TAG_VERSION}
322+
docker buildx imagetools create -t ${NAMESPACE}/sessions:latest ${NAMESPACE}/sessions:${TAG_VERSION}
323+
docker buildx imagetools create -t ${NAMESPACE}/session-queue:latest ${NAMESPACE}/session-queue:${TAG_VERSION}
324+
docker buildx imagetools create -t ${NAMESPACE}/event-bus:latest ${NAMESPACE}/event-bus:${TAG_VERSION}
325+
docker buildx imagetools create -t ${NAMESPACE}/router:latest ${NAMESPACE}/router:${TAG_VERSION}
326+
docker buildx imagetools create -t ${NAMESPACE}/distributor:latest ${NAMESPACE}/distributor:${TAG_VERSION}
327+
328+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) base latest
329+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) hub latest
330+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) node-base latest
331+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) node-chromium latest
332+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) node-firefox latest
333+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) standalone-chromium latest
334+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) standalone-firefox latest
335+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) node-docker latest
336+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) standalone-docker latest
337+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) sessions latest
338+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) session-queue latest
339+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) event-bus latest
340+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) router latest
341+
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) distributor latest
342+
220343
release_latest:
221344
docker push $(NAME)/base:latest
222345
docker push $(NAME)/hub:latest
@@ -433,6 +556,25 @@ test_firefox:
433556
test_firefox_standalone:
434557
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneFirefox
435558

559+
# Test multi-arch container images
560+
test_multi_arch: test_chromium_multi \
561+
test_firefox_multi \
562+
test_chromium_standalone_multi \
563+
test_firefox_standalone_multi
564+
565+
566+
test_chromium_multi:
567+
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh NodeChromium
568+
569+
test_chromium_standalone_multi:
570+
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneChromium
571+
572+
test_firefox_multi:
573+
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh NodeFirefox
574+
575+
test_firefox_standalone_multi:
576+
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneFirefox
577+
436578
test_parallel: hub chrome firefox edge
437579
sudo rm -rf ./tests/tests
438580
for node in DeploymentAutoscaling JobAutoscaling ; do \

NodeBase/Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ RUN apt-get update -qqy \
9797
fonts-noto-color-emoji \
9898
&& locale-gen ${LANGUAGE} \
9999
&& dpkg-reconfigure --frontend noninteractive locales \
100-
&& if [ "${TARGETARCH}" = "amd64" ]; then \
101-
apt-get -qqy --no-install-recommends install \
102-
language-pack-en \
103-
xfonts-cyrillic \
104-
fonts-ubuntu ; \
105-
fi \
106100
&& apt-get -qyy autoremove \
107101
&& rm -rf /var/lib/apt/lists/* \
108102
&& apt-get -qyy clean \

NodeChromium/Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
ARG NAMESPACE
2+
ARG VERSION
3+
ARG AUTHORS
4+
FROM ${NAMESPACE}/node-base:${VERSION}
5+
LABEL authors=${AUTHORS}
6+
7+
USER root
8+
9+
#ENV LANGUAGE=en_US.UTF-8
10+
#ENV LC_ALL=en_US.UTF-8
11+
#ENV LANG=en_US.UTF-8
12+
13+
# Deal with the usr merge issues in Debian
14+
#RUN apt install usrmerge
15+
16+
# Install Chromium
17+
# RUN echo "deb http://http.us.debian.org/debian/ stable non-free contrib main" >> /etc/apt/sources.list \
18+
RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \
19+
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 \
20+
&& apt-get update -qqy \
21+
# && apt-get -qqy install chromium=89.0.4389.82-1 \
22+
# && apt-get -qqy install chromium=90.0.4430.212-1 \
23+
# && apt-get -qqy install chromium=93.0.4577.82-1 \
24+
# && apt-get -qqy install chromium=97.0.4692.71-0.1 \
25+
# && apt-get -qqy install chromium=98.0.4758.102-1+b1 \
26+
&& apt-get -qqy install chromium \
27+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
28+
29+
#=================================
30+
# Chromium Launch Script Wrapper
31+
#=================================
32+
COPY wrap_chromium_binary /opt/bin/wrap_chromium_binary
33+
RUN /opt/bin/wrap_chromium_binary
34+
35+
#============================================
36+
# Chromium webdriver
37+
#============================================
38+
RUN apt-get update -qqy \
39+
&& apt-get -qqy install chromium-driver \
40+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
41+
42+
RUN echo "chrome" > /opt/selenium/browser_name
43+
RUN chromium --version | awk '{print $2}' > /opt/selenium/browser_version
44+
RUN echo "\"goog:chromeOptions\": {\"binary\": \"/usr/bin/chromium\"}" > /opt/selenium/browser_binary_location
45+
46+
USER 1200
47+

NodeChromium/wrap_chromium_binary

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
WRAPPER_PATH=$(readlink -f /usr/bin/chromium)
4+
BASE_PATH="$WRAPPER_PATH-base"
5+
mv "$WRAPPER_PATH" "$BASE_PATH"
6+
7+
cat > "$WRAPPER_PATH" <<_EOF
8+
#!/bin/bash
9+
# Note: exec -a below is a bashism.
10+
exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@"
11+
_EOF
12+
chmod +x "$WRAPPER_PATH"

NodeFirefox/Dockerfile.multi-arch

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
ARG NAMESPACE
2+
ARG VERSION
3+
ARG AUTHORS
4+
FROM ${NAMESPACE}/node-base:${VERSION}
5+
LABEL authors=${AUTHORS}
6+
7+
ARG TARGETARCH
8+
ARG TARGETVARIANT
9+
10+
ARG GECKODRIVER_VERSION=0.34.0
11+
12+
USER root
13+
14+
# Deal with the usr merge issues in Debian
15+
#RUN apt install usrmerge
16+
17+
#=========
18+
# Firefox
19+
#=========
20+
#RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \
21+
# && apt-get update -qqy \
22+
# && apt-get -qqy install firefox-esr libavcodec-extra \
23+
# && apt-get -qqy install firefox libavcodec-extra \
24+
# && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
25+
26+
# Pulling Firefox from Debian Snapshots so we can control which version we use as latest
27+
RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \
28+
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 \
29+
&& apt-get update -qqy \
30+
&& apt-get install libavcodec-extra firefox -y \
31+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
32+
33+
#=============
34+
# geckodriver
35+
#=============
36+
RUN if [ $TARGETARCH = "arm" ] && [ $TARGETVARIANT = "v7" ]; then \
37+
export ARCH=armhf ; \
38+
else \
39+
export ARCH=$TARGETARCH ; \
40+
fi ; \
41+
if [ -z "$ARCH" ]; then \
42+
echo "*** BUILD ERROR: \$TARGETARCH must be arm64, amd64, or arm with \$TARGETVARIANT set to v7... exiting..." ; \
43+
exit 1 ; \
44+
fi ; \
45+
if [ "$ARCH" = "arm64" ]; then \
46+
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 ; \
47+
elif [ "$ARCH" = "armhf" ]; then \
48+
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 ; \
49+
else \
50+
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 ; \
51+
fi ; \
52+
tar -C /tmp -zxf /tmp/geckodriver.tar.gz ; \
53+
rm /tmp/geckodriver.tar.gz ; \
54+
mkdir -p /opt/geckodriver-bin ; \
55+
mv /tmp/geckodriver /opt/geckodriver-bin/geckodriver ; \
56+
echo "Symlinking geckodriver to /usr/local/bin/geckodriver and /usr/bin/geckodriver" ; \
57+
ln -s /opt/geckodriver-bin/geckodriver /usr/local/bin/geckodriver ; \
58+
chmod 755 /usr/local/bin/geckodriver ; \
59+
ln -s /opt/geckodriver-bin/geckodriver /usr/bin/geckodriver ; \
60+
chmod 755 /usr/bin/geckodriver
61+
62+
USER 1200
63+
64+
#============================================
65+
# Dumping Browser name and version for config
66+
#============================================
67+
RUN echo "firefox" > /opt/selenium/browser_name
68+
RUN firefox --version | awk '{print $3}' > /opt/selenium/browser_version
69+
RUN echo "\"moz:firefoxOptions\": {\"binary\": \"/usr/bin/firefox\"}" > /opt/selenium/browser_binary_location

0 commit comments

Comments
 (0)