From 7d944a99170d8152bf4f87f9eecc5ed7545696e8 Mon Sep 17 00:00:00 2001 From: Ivan Larin Date: Wed, 5 Feb 2020 19:38:45 +0300 Subject: [PATCH] Multiarch builds fixed for #4 --- Dockerfile | 3 ++- install_actions.sh | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index c45377bc..d9d9a430 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ LABEL maintainer="3vilpenguin@gmail.com" ARG GIT_VERSION="2.23.0" ARG GH_RUNNER_VERSION="2.165.1" +ARG TARGETPLATFORM SHELL ["/bin/bash", "-o", "pipefail", "-c"] # hadolint ignore=DL3003 @@ -43,7 +44,7 @@ WORKDIR /actions-runner COPY install_actions.sh /actions-runner RUN chmod +x /actions-runner/install_actions.sh \ - && /actions-runner/install_actions.sh ${GH_RUNNER_VERSION} \ + && /actions-runner/install_actions.sh ${GH_RUNNER_VERSION} ${TARGETPLATFORM} \ && rm /actions-runner/install_actions.sh WORKDIR /_work diff --git a/install_actions.sh b/install_actions.sh index 55cb9683..c612a59c 100644 --- a/install_actions.sh +++ b/install_actions.sh @@ -1,13 +1,14 @@ #!/bin/bash -x GH_RUNNER_VERSION=$1 +TARGETPLATFORM=$2 -export ACTIONS_ARCH="x64" -if [[ $(dpkg --print-architecture) == "armhf" ]]; then - export ACTIONS_ARCH="arm" -elif [[ $(dpkg --print-architecture) == "arm64" ]]; then - export ACTIONS_ARCH="arm64" +export TARGET_ARCH="x64" +if [[ $TARGETPLATFORM == "linux/arm/v7" ]]; then + export TARGET_ARCH="arm" +elif [[ $TARGETPLATFORM == "linux/arm64" ]]; then + export TARGET_ARCH="arm64" fi -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 +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 tar -zxf actions.tar.gz rm -f actions.tar.gz ./bin/installdependencies.sh