chore: build arm/v5 image

master
Shengjing Zhu 2022-07-25 01:12:26 +08:00
parent 6962a4bdc6
commit 45f802ec6f
2 changed files with 10 additions and 4 deletions

View File

@ -18,13 +18,18 @@ RUN <<EOF
git archive --prefix=github.com/zhsj/wghttp@"$tag"/ -o "$file_prefix".zip HEAD
EOF
ARG TARGETARCH
ARG TARGETARCH TARGETVARIANT
RUN <<EOF
set -ex
export CGO_ENABLED=0
export GOARCH=$TARGETARCH
export GOPROXY=file://$(go env GOMODCACHE)/cache/download
export GOSUMDB=off
export GOARCH="$TARGETARCH"
case "$TARGETARCH" in
arm|arm64)
export GOARM=$(echo "$TARGETVARIANT"|sed 's/^v//')
;;
esac
tag=$(git describe --tags --abbrev=8 --always)
go install -trimpath -ldflags="-w -s" github.com/zhsj/wghttp@"$tag"
cross_bin=/go/bin/$(go env GOOS)_$(go env GOARCH)/wghttp

View File

@ -6,8 +6,9 @@ target "build" {
platforms = [
"linux/386",
"linux/amd64",
"linux/arm",
"linux/arm64",
"linux/arm/v5",
"linux/arm/v7",
"linux/arm64/v8",
"linux/mips",
"linux/mips64",
"linux/mips64le",