Skip to content

Commit

Permalink
Merge pull request #5 from Pentusha/master
Browse files Browse the repository at this point in the history
Multiarch builds fixed for #4
  • Loading branch information
myoung34 authored Feb 5, 2020
2 parents 000da19 + 7d944a9 commit efdec6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ LABEL maintainer="[email protected]"

ARG GIT_VERSION="2.23.0"
ARG GH_RUNNER_VERSION="2.165.1"
ARG TARGETPLATFORM

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003
Expand Down Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions install_actions.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit efdec6a

Please sign in to comment.