Skip to content

Commit

Permalink
Merge pull request #2 from yinjiayi/dev
Browse files Browse the repository at this point in the history
feat(arch): add riscv64 support
  • Loading branch information
wzzc-dev authored Jan 16, 2024
2 parents 7673e4f + fdac6f5 commit 53b944c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
provenance: false
21 changes: 17 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 53b944c

Please sign in to comment.