Skip to content

Commit f2db215

Browse files
committed
Issue #455 - Build image using multiple platform architectures
1 parent 7818279 commit f2db215

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

.github/workflows/docker-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ jobs:
4242
uses: docker/build-push-action@v6
4343
with:
4444
# Only build one platform in order to run tests (additional platforms will be built afterwards, before push)
45-
platforms: linux/amd64
45+
# platforms: linux/amd64
46+
platforms: linux/amd64,linux/arm64
4647
push: false
4748
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION_CI }}
4849
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache

Dockerfile

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ FROM fedora:42
33
LABEL authors="Paul Podgorsek"
44
LABEL description="Robot Framework in Docker"
55

6+
# This image is intended to be built using one of the following platforms:
7+
# * linux/arm64
8+
# * linux/amd64"
9+
610
# Set the Python dependencies' directory environment variable
711
ENV ROBOT_DEPENDENCY_DIR="/opt/robotframework/dependencies"
812

@@ -104,23 +108,38 @@ RUN pip3 install \
104108

105109
# Gecko drivers
106110
# Download Gecko drivers directly from the GitHub repository
107-
RUN wget -q "https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz" \
108-
&& tar xzf geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz \
111+
RUN if [ `uname --machine` == "x86_64" ]; \
112+
then \
113+
export PLATFORM="linux64"; \
114+
else \
115+
export PLATFORM="aarch64"; \
116+
fi \
117+
&& wget -q "https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-${PLATFORM}.tar.gz" \
118+
&& tar xzf geckodriver-$GECKO_DRIVER_VERSION-${PLATFORM}.tar.gz \
109119
&& mkdir -p /opt/robotframework/drivers/ \
110120
&& mv geckodriver /opt/robotframework/drivers/geckodriver \
111-
&& rm geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz
121+
&& rm geckodriver-$GECKO_DRIVER_VERSION-${PLATFORM}.tar.gz
112122

113123
# Install Microsoft Edge & webdriver
114-
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
124+
RUN if [ `uname --machine` == "x86_64" ]; \
125+
then \
126+
export PLATFORM="linux64"; \
127+
else \
128+
echo "Microsoft Edge is not available for Linux ARM."; \
129+
echo "Please visit the official Microsoft Edge website for more information: https://www.microsoft.com/en-us/edge/business/download"; \
130+
echo "The Arm developer website is also a useful source: https://learn.arm.com/install-guides/browsers/edge/"; \
131+
exit 0; \
132+
fi \
133+
&& rpm --import https://packages.microsoft.com/keys/microsoft.asc \
115134
&& dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/yumrepos/edge/config.repo \
116135
&& dnf install -y \
117136
microsoft-edge-stable-${MICROSOFT_EDGE_VERSION} \
118137
zip \
119-
&& wget -q "https://msedgedriver.microsoft.com/${MICROSOFT_EDGE_VERSION}/edgedriver_linux64.zip" \
120-
&& unzip edgedriver_linux64.zip -d edge \
138+
&& wget -q "https://msedgedriver.microsoft.com/${MICROSOFT_EDGE_VERSION}/edgedriver_${PLATFORM}.zip" \
139+
&& unzip edgedriver_${PLATFORM}.zip -d edge \
121140
&& mv edge/msedgedriver /opt/robotframework/drivers/msedgedriver \
122141
&& chmod ugo+x /opt/robotframework/drivers/msedgedriver \
123-
&& rm -Rf edgedriver_linux64.zip edge/ \
142+
&& rm -Rf edgedriver_${PLATFORM}.zip edge/ \
124143
# IMPORTANT: don't remove the wget package because it's a dependency of Microsoft Edge
125144
&& dnf remove -y \
126145
zip \

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,11 @@ docker run \
479479
ppodgorsek/robot-framework:<version>
480480
```
481481

482-
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.
482+
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.
483483

484-
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.
484+
**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.**
485+
486+
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.
485487

486488
<a name="please-contribute"></a>
487489

0 commit comments

Comments
 (0)