From 9ea180ef42895471092d92bef38e817dc80e7c8f Mon Sep 17 00:00:00 2001 From: Carlos de Paula Date: Mon, 30 Mar 2020 16:20:11 -0300 Subject: [PATCH] Add image build for ppc64le architecture Signed-off-by: Carlos de Paula --- hack/build.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hack/build.sh b/hack/build.sh index 62c3f0b..dfaa386 100755 --- a/hack/build.sh +++ b/hack/build.sh @@ -26,6 +26,19 @@ go build \ -ldflags '-extldflags "-static"' \ -o /metrics-sidecar github.com/kubernetes-sigs/dashboard-metrics-scraper +elif [[ "$GOARCH" = "ppc64le" ]]; then + +echo "Detected ppc64le. Setting additional variables."; + +apt-get install -y gcc-powerpc64le-linux-gnu + +env CC=powerpc64le-linux-gnu-gcc \ +CGO_ENABLED=1 GOOS=linux \ +go build \ +-installsuffix 'static' \ +-ldflags '-extldflags "-static"' \ +-o /metrics-sidecar github.com/kubernetes-sigs/dashboard-metrics-scraper + elif [[ "$GOARCH" = "s390x" ]]; then echo "Detected s390x. Setting additional variables.";