Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
- name: checkout
uses: actions/checkout@v6

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

Expand Down Expand Up @@ -50,6 +53,7 @@ jobs:
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
39 changes: 28 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM --platform=linux/amd64 ubuntu:26.04
FROM ubuntu:26.04

# Populated automatically by Docker Buildx (amd64 / arm64)
ARG TARGETARCH

ENV FIREFOX_VERSION="138.0.4"
ENV GECKODRIVER_VERSION="0.36.0"
Expand All @@ -13,7 +16,12 @@ RUN $INSTALL wget ca-certificates xz-utils bzip2 unzip
# firefox setup
RUN $INSTALL libgtk-3-0t64 libasound2t64 libx11-xcb1

RUN wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.xz && \
RUN case "$TARGETARCH" in \
amd64) FFARCH=linux-x86_64 ;; \
arm64) FFARCH=linux-aarch64 ;; \
*) echo "unsupported TARGETARCH: $TARGETARCH" && exit 1 ;; \
esac && \
wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/${FFARCH}/en-US/firefox-${FIREFOX_VERSION}.tar.xz && \
tar -xf firefox-${FIREFOX_VERSION}.tar.xz && \
mv firefox /usr/local/share && \
ln -s /usr/local/share/firefox/firefox /usr/local/bin && \
Expand All @@ -22,19 +30,28 @@ RUN wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREF
RUN firefox --version

# geckodriver setup
RUN wget https://github.com/mozilla/geckodriver/releases/download/v${GECKODRIVER_VERSION}/geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz && \
tar -xf geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz && \
RUN case "$TARGETARCH" in \
amd64) GDARCH=linux64 ;; \
arm64) GDARCH=linux-aarch64 ;; \
*) echo "unsupported TARGETARCH: $TARGETARCH" && exit 1 ;; \
esac && \
wget https://github.com/mozilla/geckodriver/releases/download/v${GECKODRIVER_VERSION}/geckodriver-v${GECKODRIVER_VERSION}-${GDARCH}.tar.gz && \
tar -xf geckodriver-v${GECKODRIVER_VERSION}-${GDARCH}.tar.gz && \
mv geckodriver /usr/local/bin && \
rm geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz
rm geckodriver-v${GECKODRIVER_VERSION}-${GDARCH}.tar.gz

RUN geckodriver --version

# chrome setup
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
$INSTALL ./google-chrome-stable_current_amd64.deb && \
rm google-chrome-stable_current_amd64.deb

RUN google-chrome --version
# chrome setup (Google Chrome ships no ARM64 Linux build, so amd64 only;
# use --driver firefox, the default, on arm64)
RUN if [ "$TARGETARCH" = "amd64" ]; then \
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
$INSTALL ./google-chrome-stable_current_amd64.deb && \
rm google-chrome-stable_current_amd64.deb && \
google-chrome --version ; \
else \
echo "Skipping Google Chrome on $TARGETARCH (no ARM64 build; use --driver firefox)" ; \
fi

# install python dependencies
COPY . /compare-html
Expand Down
Loading