From c0aac0d0d118d5c721162304571557cfad7e94dd Mon Sep 17 00:00:00 2001 From: Jiayi Yin Date: Sun, 17 Sep 2023 22:49:34 +0800 Subject: [PATCH 1/2] feat(arch): add riscv64 support --- Dockerfile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4affd81..8389bdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,16 +12,29 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.18-alpine3.14 as builder +FROM alpine:edge as builder WORKDIR /opt/ COPY . . -RUN go env -w CGO_ENABLED=0 && go env -w GO111MODULE=on && go build -o space-aofs -FROM alpine:3.14 +RUN apk add wget \ + && cd / && arch=$(uname -m) \ + && case "$arch" in x86_64) arch="amd64"; ;; \ + aarch64) arch="arm64"; ;; \ + riscv64) arch="riscv64"; ;; \ + *) arch="Unknown"; ;; esac \ + && wget https://go.dev/dl/go1.21.1.linux-$arch.tar.gz \ + && tar -xzvf go1.21.1.linux-$arch.tar.gz \ + && export PATH=$PATH:/go/bin && cd /opt/ \ + && go env -w CGO_ENABLED=0 \ + && go env -w GO111MODULE=on \ + && go build -o space-aofs -RUN apk --no-cache add ntfs-3g lsblk exfat-utils fuse-exfat usbutils mediainfo eudev +FROM alpine:edge + +RUN apk --no-cache add wget ntfs-3g \ + lsblk exfat-utils fuse-exfat usbutils mediainfo eudev COPY --from=builder /opt/space-aofs /usr/bin COPY --from=builder /opt/template/ /tmp/ RUN chmod +x /usr/bin/space-aofs From fdac6f51084a1f1c5ca6a562db7b2dc38e6e739f Mon Sep 17 00:00:00 2001 From: Jiayi Yin Date: Mon, 18 Sep 2023 08:09:44 +0800 Subject: [PATCH 2/2] feat(arch): add riscv64 support --- .github/workflows/container.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 6cea02b..a99e1d0 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -168,8 +168,8 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} builder: ${{ steps.buildx.outputs.name }} - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64,linux/riscv64 cache-from: type=gha cache-to: type=gha,mode=max file: Dockerfile - provenance: false \ No newline at end of file + provenance: false