Skip to content

Commit

Permalink
build juicefs arm64 binary staticly linked (#5612)
Browse files Browse the repository at this point in the history
  • Loading branch information
chnliyong authored Jan 26, 2025
1 parent 114e15e commit e59b0b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ builds:
- amd64
- id: juicefs-linux-arm64
env:
- CC=aarch64-linux-gnu-gcc
ldflags: -s -w -X github.com/juicedata/juicefs/pkg/version.version={{.Version}} -X github.com/juicedata/juicefs/pkg/version.revision={{.ShortCommit}} -X github.com/juicedata/juicefs/pkg/version.revisionDate={{.Env.REVISIONDATE}}
- CC=/usr/local/aarch64-linux-musl-cross/bin/aarch64-linux-musl-cc
ldflags: -s -w -X github.com/juicedata/juicefs/pkg/version.version={{.Version}} -X github.com/juicedata/juicefs/pkg/version.revision={{.ShortCommit}} -X github.com/juicedata/juicefs/pkg/version.revisionDate={{.Env.REVISIONDATE}} -linkmode external -extldflags '-static'
main: .
goos:
- linux
Expand Down
6 changes: 4 additions & 2 deletions hack/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ghcr.io/gythialy/golang-cross:v1.21.9-0

RUN apt-get update && apt-get install -y musl-tools && apt -y autoremove && \
RUN apt-get update && apt-get install -y musl-tools && apt-get -y autoremove && \
apt-get clean && rm -rf /var/cache/apt/* /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
git config --global --add safe.directory /go/src/github.com/juicedata/juicefs
git config --global --add safe.directory /go/src/github.com/juicedata/juicefs && \
curl -fsSL -o /tmp/aarch64-linux-musl-cross.tgz https://musl.cc/aarch64-linux-musl-cross.tgz && \
tar -xf /tmp/aarch64-linux-musl-cross.tgz -C /usr/local/ && rm -f /tmp/aarch64-linux-musl-cross.tgz

0 comments on commit e59b0b1

Please sign in to comment.