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

Commit

Permalink
Update to also support arm64 architecture (except edge and chrome)
Browse files Browse the repository at this point in the history
  • Loading branch information
fhoeben committed Dec 17, 2023
1 parent 47c5257 commit 82b88b3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
12 changes: 8 additions & 4 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ USER root
#================================================
# Customize sources for apt-get
#================================================
RUN echo "deb http://archive.ubuntu.com/ubuntu jammy main universe\n" > /etc/apt/sources.list \
&& echo "deb http://archive.ubuntu.com/ubuntu jammy-updates main universe\n" >> /etc/apt/sources.list \
&& echo "deb http://security.ubuntu.com/ubuntu jammy-security main universe\n" >> /etc/apt/sources.list
RUN echo "deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy main universe\n" > /etc/apt/sources.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main universe\n" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy-updates main universe\n" >> /etc/apt/sources.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main universe\n" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu jammy-security main universe\n" >> /etc/apt/sources.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main universe\n" >> /etc/apt/sources.list

# No interactive frontend during docker build
ENV DEBIAN_FRONTEND=noninteractive \
Expand All @@ -47,7 +50,8 @@ RUN apt-get -qqy update \
gnupg2 \
libnss3-tools \
&& 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
&& ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \
&& 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
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ all: hub \
video


all_arm: hub \
distributor \
router \
sessions \
sessionqueue \
event_bus \
firefox \
chromium \
docker \
standalone_firefox \
standalone_chromium \
standalone_docker \
video

build: all

ci: build test
Expand Down Expand Up @@ -350,6 +364,10 @@ test: test_chrome \
test_chromium \
test_chromium_standalone

test_arm: test_chromium \
test_firefox \
test_chromium_standalone \
test_firefox_standalone

test_chrome:
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeChrome
Expand Down
28 changes: 15 additions & 13 deletions NodeFirefox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,29 @@ USER root

#=========
# Firefox
# Available versions at https://launchpad.net/~mozillateam/+archive/ubuntu/ppa
#=========
ARG FIREFOX_VERSION=latest
RUN FIREFOX_DOWNLOAD_URL=$(if [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERSION = "beta-latest" ] || [ $FIREFOX_VERSION = "nightly-latest" ] || [ $FIREFOX_VERSION = "devedition-latest" ] || [ $FIREFOX_VERSION = "esr-latest" ]; then echo "https://download.mozilla.org/?product=firefox-$FIREFOX_VERSION-ssl&os=linux64&lang=en-US"; else echo "https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2"; fi) \
&& apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install libavcodec-extra \
libgtk-3-dev libdbus-glib-1-dev \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& wget --no-verbose -O /tmp/firefox.tar.bz2 $FIREFOX_DOWNLOAD_URL \
&& rm -rf /opt/firefox \
&& tar -C /opt -xjf /tmp/firefox.tar.bz2 \
&& rm /tmp/firefox.tar.bz2 \
&& mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \
&& ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox
ARG FIREFOX_VERSION=121.0+build1-0ubuntu0.22.04.1~mt1
RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install libavcodec-extra software-properties-common \
&& add-apt-repository ppa:mozillateam/ppa \
&& apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install -t 'o=LP-PPA-mozillateam' firefox=${FIREFOX_VERSION} \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#============
# GeckoDriver
#============
ARG GECKODRIVER_VERSION=latest
RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.33.0"; else echo $GECKODRIVER_VERSION; fi) \
&& echo "Using GeckoDriver version: "$GK_VERSION \
&& wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux64.tar.gz \
&& ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \
&& if [ "$ARCH" = "arm64" ]; then \
GK_DOWNLOAD_URL="https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux-aarch64.tar.gz" ; \
else \
GK_DOWNLOAD_URL="https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux64.tar.gz" ; \
fi \
&& wget --no-verbose -O /tmp/geckodriver.tar.gz $GK_DOWNLOAD_URL \
&& rm -rf /opt/geckodriver \
&& tar -C /opt -zxf /tmp/geckodriver.tar.gz \
&& rm /tmp/geckodriver.tar.gz \
Expand Down

0 comments on commit 82b88b3

Please sign in to comment.