diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2dc0415..3b6e6d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,10 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: docker/setup-qemu-action@v1 + + - uses: docker/setup-buildx-action@v1 + - uses: docker/login-action@v1 if: github.event_name != 'pull_request' with: @@ -54,6 +58,7 @@ jobs: - uses: docker/build-push-action@v2 with: context: ${{ matrix.context }} + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/alpine3.12/Dockerfile b/alpine3.12/Dockerfile index c134855..f9a32f7 100644 --- a/alpine3.12/Dockerfile +++ b/alpine3.12/Dockerfile @@ -1,15 +1,22 @@ FROM alpine:3.12 +RUN apk add --no-cache \ + ca-certificates \ + gcc + ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH RUN set -eux; \ - apk add --no-cache \ - ca-certificates \ - gcc; \ + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + x86_64) rustArch='x86_64-unknown-linux-musl' ;; \ + aarch64) rustArch='aarch64-unknown-linux-musl' ;; \ + *) echo >&2 "unsupported architecture: $apkArch"; exit 1 ;; \ + esac; \ \ - url="https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-musl/rustup-init"; \ + url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ wget "$url"; \ chmod +x rustup-init; \ ./rustup-init -y --no-modify-path --default-toolchain nightly; \ diff --git a/bullseye/Dockerfile b/bullseye/Dockerfile index c196166..37a7952 100644 --- a/bullseye/Dockerfile +++ b/bullseye/Dockerfile @@ -5,8 +5,14 @@ ENV RUSTUP_HOME=/usr/local/rustup \ PATH=/usr/local/cargo/bin:$PATH RUN set -eux; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) rustArch='x86_64-unknown-linux-gnu' ;; \ + arm64) rustArch='aarch64-unknown-linux-gnu' ;; \ + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ + esac; \ \ - url="https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init"; \ + url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ wget "$url"; \ chmod +x rustup-init; \ ./rustup-init -y --no-modify-path --default-toolchain nightly; \ diff --git a/bullseye/slim/Dockerfile b/bullseye/slim/Dockerfile index 82b1add..6bea924 100644 --- a/bullseye/slim/Dockerfile +++ b/bullseye/slim/Dockerfile @@ -12,8 +12,14 @@ RUN set -eux; \ libc6-dev \ wget \ ; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) rustArch='x86_64-unknown-linux-gnu' ;; \ + arm64) rustArch='aarch64-unknown-linux-gnu' ;; \ + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ + esac; \ \ - url="https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init"; \ + url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ wget "$url"; \ chmod +x rustup-init; \ ./rustup-init -y --no-modify-path --default-toolchain nightly; \ diff --git a/buster/Dockerfile b/buster/Dockerfile index 2160227..b9f1274 100644 --- a/buster/Dockerfile +++ b/buster/Dockerfile @@ -5,8 +5,14 @@ ENV RUSTUP_HOME=/usr/local/rustup \ PATH=/usr/local/cargo/bin:$PATH RUN set -eux; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) rustArch='x86_64-unknown-linux-gnu' ;; \ + arm64) rustArch='aarch64-unknown-linux-gnu' ;; \ + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ + esac; \ \ - url="https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init"; \ + url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ wget "$url"; \ chmod +x rustup-init; \ ./rustup-init -y --no-modify-path --default-toolchain nightly; \ diff --git a/buster/slim/Dockerfile b/buster/slim/Dockerfile index 25c8bf6..4d7c0ec 100644 --- a/buster/slim/Dockerfile +++ b/buster/slim/Dockerfile @@ -12,8 +12,14 @@ RUN set -eux; \ libc6-dev \ wget \ ; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) rustArch='x86_64-unknown-linux-gnu' ;; \ + arm64) rustArch='aarch64-unknown-linux-gnu' ;; \ + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ + esac; \ \ - url="https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init"; \ + url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ wget "$url"; \ chmod +x rustup-init; \ ./rustup-init -y --no-modify-path --default-toolchain nightly; \