From f2db215bcfbbe9e5fc930b62d907d6e23fd65e3f Mon Sep 17 00:00:00 2001 From: Paul Podgorsek Date: Tue, 11 Nov 2025 16:08:43 +0000 Subject: [PATCH 1/4] Issue #455 - Build image using multiple platform architectures --- .github/workflows/docker-build.yml | 3 ++- Dockerfile | 33 +++++++++++++++++++++++------- README.md | 6 ++++-- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 68eb11e..b2dd6bd 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -42,7 +42,8 @@ jobs: uses: docker/build-push-action@v6 with: # Only build one platform in order to run tests (additional platforms will be built afterwards, before push) - platforms: linux/amd64 + # platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: false tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION_CI }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache diff --git a/Dockerfile b/Dockerfile index bfa43ad..03ab499 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,10 @@ FROM fedora:42 LABEL authors="Paul Podgorsek" LABEL description="Robot Framework in Docker" +# This image is intended to be built using one of the following platforms: +# * linux/arm64 +# * linux/amd64" + # Set the Python dependencies' directory environment variable ENV ROBOT_DEPENDENCY_DIR="/opt/robotframework/dependencies" @@ -104,23 +108,38 @@ RUN pip3 install \ # Gecko drivers # Download Gecko drivers directly from the GitHub repository -RUN wget -q "https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz" \ - && tar xzf geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz \ +RUN if [ `uname --machine` == "x86_64" ]; \ + then \ + export PLATFORM="linux64"; \ + else \ + export PLATFORM="aarch64"; \ + fi \ + && wget -q "https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-${PLATFORM}.tar.gz" \ + && tar xzf geckodriver-$GECKO_DRIVER_VERSION-${PLATFORM}.tar.gz \ && mkdir -p /opt/robotframework/drivers/ \ && mv geckodriver /opt/robotframework/drivers/geckodriver \ - && rm geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz + && rm geckodriver-$GECKO_DRIVER_VERSION-${PLATFORM}.tar.gz # Install Microsoft Edge & webdriver -RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \ +RUN if [ `uname --machine` == "x86_64" ]; \ + then \ + export PLATFORM="linux64"; \ + else \ + echo "Microsoft Edge is not available for Linux ARM."; \ + echo "Please visit the official Microsoft Edge website for more information: https://www.microsoft.com/en-us/edge/business/download"; \ + echo "The Arm developer website is also a useful source: https://learn.arm.com/install-guides/browsers/edge/"; \ + exit 0; \ + fi \ + && rpm --import https://packages.microsoft.com/keys/microsoft.asc \ && dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/yumrepos/edge/config.repo \ && dnf install -y \ microsoft-edge-stable-${MICROSOFT_EDGE_VERSION} \ zip \ - && wget -q "https://msedgedriver.microsoft.com/${MICROSOFT_EDGE_VERSION}/edgedriver_linux64.zip" \ - && unzip edgedriver_linux64.zip -d edge \ + && wget -q "https://msedgedriver.microsoft.com/${MICROSOFT_EDGE_VERSION}/edgedriver_${PLATFORM}.zip" \ + && unzip edgedriver_${PLATFORM}.zip -d edge \ && mv edge/msedgedriver /opt/robotframework/drivers/msedgedriver \ && chmod ugo+x /opt/robotframework/drivers/msedgedriver \ - && rm -Rf edgedriver_linux64.zip edge/ \ + && rm -Rf edgedriver_${PLATFORM}.zip edge/ \ # IMPORTANT: don't remove the wget package because it's a dependency of Microsoft Edge && dnf remove -y \ zip \ diff --git a/README.md b/README.md index 5b87c6e..8c06b1f 100644 --- a/README.md +++ b/README.md @@ -479,9 +479,11 @@ docker run \ ppodgorsek/robot-framework: ``` -Please note: builds and automated tests of this project will remain performed on a `linux/amd64` architecture so such emulation might not work, depending on your device and operating system. +Please note that builds and automated tests of this project are only performed on `linux/amd64` and `linux/arm64` architectures so such emulation might not work, depending on your device and operating system. -If this does not solve your platform-related issues, you will have to rebuild the image for your device/platform, specifying that `--platform` option during the build and run. +**It is to be noted that Microsoft Edge is not available for Linux ARM. Please visit [the official Microsoft Edge website](https://www.microsoft.com/en-us/edge/business/download) and [the Arm developer website](https://learn.arm.com/install-guides/browsers/edge/) for more information.** + +If this does not solve your platform-related issues, you might have to rebuild the image for your device/platform, specifying that `--platform` option during the build and run. From 2716c838f1856e3af89b2eef131345b9b972b024 Mon Sep 17 00:00:00 2001 From: Paul Podgorsek Date: Tue, 11 Nov 2025 17:00:38 +0000 Subject: [PATCH 2/4] Removed the Docker login step from the tests, as an anonymous pull is sufficient --- .github/workflows/docker-build.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index b2dd6bd..d68fdd7 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -66,12 +66,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} - password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} - - name: Pull image from cache uses: docker/build-push-action@v6 with: From b69b92f215611b79802e99f2ffbdb2d82d9951c1 Mon Sep 17 00:00:00 2001 From: Paul Podgorsek Date: Tue, 11 Nov 2025 17:40:00 +0000 Subject: [PATCH 3/4] Fixed an issue with the download of the Gecko driver for Linux ARM platforms --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 03ab499..37ba48e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -112,13 +112,13 @@ RUN if [ `uname --machine` == "x86_64" ]; \ then \ export PLATFORM="linux64"; \ else \ - export PLATFORM="aarch64"; \ + export PLATFORM="linux-aarch64"; \ fi \ - && wget -q "https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-${PLATFORM}.tar.gz" \ - && tar xzf geckodriver-$GECKO_DRIVER_VERSION-${PLATFORM}.tar.gz \ + && wget -q "https://github.com/mozilla/geckodriver/releases/download/${GECKO_DRIVER_VERSION}/geckodriver-${GECKO_DRIVER_VERSION}-${PLATFORM}.tar.gz" \ + && tar xzf geckodriver-${GECKO_DRIVER_VERSION}-${PLATFORM}.tar.gz \ && mkdir -p /opt/robotframework/drivers/ \ && mv geckodriver /opt/robotframework/drivers/geckodriver \ - && rm geckodriver-$GECKO_DRIVER_VERSION-${PLATFORM}.tar.gz + && rm geckodriver-${GECKO_DRIVER_VERSION}-${PLATFORM}.tar.gz # Install Microsoft Edge & webdriver RUN if [ `uname --machine` == "x86_64" ]; \ From 7440b8e2db95697ff87a59985e4509a8c0ea4d48 Mon Sep 17 00:00:00 2001 From: Paul Podgorsek Date: Tue, 11 Nov 2025 18:11:25 +0000 Subject: [PATCH 4/4] Reverted a change to test the build --- .github/workflows/docker-build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d68fdd7..a4c99a5 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -42,8 +42,7 @@ jobs: uses: docker/build-push-action@v6 with: # Only build one platform in order to run tests (additional platforms will be built afterwards, before push) - # platforms: linux/amd64 - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: false tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION_CI }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache