Skip to content

Commit efdec6a

Browse files
authored
Merge pull request #5 from Pentusha/master
Multiarch builds fixed for #4
2 parents 000da19 + 7d944a9 commit efdec6a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ LABEL maintainer="[email protected]"
33

44
ARG GIT_VERSION="2.23.0"
55
ARG GH_RUNNER_VERSION="2.165.1"
6+
ARG TARGETPLATFORM
67

78
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
89
# hadolint ignore=DL3003
@@ -43,7 +44,7 @@ WORKDIR /actions-runner
4344
COPY install_actions.sh /actions-runner
4445

4546
RUN chmod +x /actions-runner/install_actions.sh \
46-
&& /actions-runner/install_actions.sh ${GH_RUNNER_VERSION} \
47+
&& /actions-runner/install_actions.sh ${GH_RUNNER_VERSION} ${TARGETPLATFORM} \
4748
&& rm /actions-runner/install_actions.sh
4849

4950
WORKDIR /_work

install_actions.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/bin/bash -x
22
GH_RUNNER_VERSION=$1
3+
TARGETPLATFORM=$2
34

4-
export ACTIONS_ARCH="x64"
5-
if [[ $(dpkg --print-architecture) == "armhf" ]]; then
6-
export ACTIONS_ARCH="arm"
7-
elif [[ $(dpkg --print-architecture) == "arm64" ]]; then
8-
export ACTIONS_ARCH="arm64"
5+
export TARGET_ARCH="x64"
6+
if [[ $TARGETPLATFORM == "linux/arm/v7" ]]; then
7+
export TARGET_ARCH="arm"
8+
elif [[ $TARGETPLATFORM == "linux/arm64" ]]; then
9+
export TARGET_ARCH="arm64"
910
fi
10-
curl -L "https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz" > actions.tar.gz
11+
curl -L "https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/actions-runner-linux-${TARGET_ARCH}-${GH_RUNNER_VERSION}.tar.gz" > actions.tar.gz
1112
tar -zxf actions.tar.gz
1213
rm -f actions.tar.gz
1314
./bin/installdependencies.sh

0 commit comments

Comments
 (0)