diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index bf0dbfc27e8..fa906b29403 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -53,6 +53,9 @@ jobs: uses: docker/build-push-action@v3 with: context: ./images + platforms: | + linux/amd64 + linux/arm64 tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.image.outputs.version }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest diff --git a/images/Dockerfile b/images/Dockerfile index c1ab96d27d1..edfd100f211 100644 --- a/images/Dockerfile +++ b/images/Dockerfile @@ -1,15 +1,19 @@ # Source: https://github.com/dotnet/dotnet-docker FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-jammy as build +ARG TARGETOS +ARG TARGETARCH ARG RUNNER_VERSION -ARG RUNNER_ARCH="x64" ARG RUNNER_CONTAINER_HOOKS_VERSION=0.3.2 +ARG RUNNER_ARCH="x64" ARG DOCKER_VERSION=20.10.23 RUN apt update -y && apt install curl unzip -y WORKDIR /actions-runner -RUN curl -f -L -o runner.tar.gz https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-${RUNNER_ARCH}-${RUNNER_VERSION}.tar.gz \ +RUN export RUNNER_ARCH=${TARGETARCH} \ + && if [ "$RUNNER_ARCH" = "amd64" ]; then export RUNNER_ARCH=x64 ; fi \ + && curl -f -L -o runner.tar.gz https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-${TARGETOS}-${RUNNER_ARCH}-${RUNNER_VERSION}.tar.gz \ && tar xzf ./runner.tar.gz \ && rm runner.tar.gz @@ -17,9 +21,10 @@ RUN curl -f -L -o runner-container-hooks.zip https://github.com/actions/runner-c && unzip ./runner-container-hooks.zip -d ./k8s \ && rm runner-container-hooks.zip -RUN export DOCKER_ARCH=x86_64 \ +RUN export RUNNER_ARCH=${TARGETARCH} \ + && if [ "$RUNNER_ARCH" = "amd64" ]; then export DOCKER_ARCH=x86_64 ; fi \ && if [ "$RUNNER_ARCH" = "arm64" ]; then export DOCKER_ARCH=aarch64 ; fi \ - && curl -fLo docker.tgz https://download.docker.com/linux/static/stable/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz \ + && curl -fLo docker.tgz https://download.docker.com/${TARGETOS}/static/stable/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz \ && tar zxvf docker.tgz \ && rm -rf docker.tgz