From 20af50692a6d3cb7efad4278d897e43a7f3fb719 Mon Sep 17 00:00:00 2001 From: Ming Date: Wed, 9 Nov 2022 10:30:55 +0000 Subject: [PATCH] Fix restic cross platform compile Signed-off-by: Ming --- Dockerfile | 2 +- hack/build-restic.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8b96b7c97e..f9cec8f624 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,8 +43,8 @@ ENV GOOS=${TARGETOS} \ GOARM=${TARGETVARIANT} RUN mkdir -p /output/usr/bin && \ - bash ./hack/build-restic.sh && \ export GOARM=$( echo "${GOARM}" | cut -c2-) && \ + bash ./hack/build-restic.sh && \ go build -o /output/${BIN} \ -ldflags "${LDFLAGS}" ${PKG}/cmd/${BIN} diff --git a/hack/build-restic.sh b/hack/build-restic.sh index e1e42a2854..5859414fd3 100755 --- a/hack/build-restic.sh +++ b/hack/build-restic.sh @@ -50,6 +50,6 @@ fi mkdir ${build_path}/restic git clone -b v${RESTIC_VERSION} https://github.com/restic/restic.git ${build_path}/restic pushd ${build_path}/restic -go run build.go -o ${restic_bin} +go run build.go --goos "${GOOS}" --goarch "${GOARCH}" --goarm "${GOARM}" -o ${restic_bin} chmod +x ${restic_bin} popd