From 5fef12716637a98150184eb1163c4a7e079c1e40 Mon Sep 17 00:00:00 2001 From: Brendan Galloway Date: Thu, 20 Jun 2024 10:32:29 +0200 Subject: [PATCH] feat: add static binary for alpine support --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 89814f0..f06ce68 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ help: @cat docs/developer-guide/make-targets.md .PHONY: release -release: linux compress +release: linux alpine compress .PHONY: build build: @@ -33,6 +33,12 @@ linux: cp .bin/$(NAME)_linux-amd64 .bin/$(NAME) GOOS=linux GOARCH=arm64 go build -ldflags "-X \"main.version=$(VERSION_TAG)\"" -o .bin/$(NAME)_linux-arm64 +.PHONY: alpine +linux: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X \"main.version=$(VERSION_TAG)\"" -o .bin/$(NAME)_alpine-amd64 + cp .bin/$(NAME)_linux-amd64 .bin/$(NAME) + GCGO_ENABLED=0 OOS=linux GOARCH=arm64 go build -ldflags "-X \"main.version=$(VERSION_TAG)\"" -o .bin/$(NAME)_alpine-arm64 + .PHONY: darwin darwin: GOOS=darwin GOARCH=amd64 go build -ldflags "-X \"main.version=$(VERSION_TAG)\"" -o .bin/$(NAME)_darwin-amd64 @@ -53,4 +59,4 @@ install: .PHONY: lint lint: build - golangci-lint run --verbose --print-resources-usage \ No newline at end of file + golangci-lint run --verbose --print-resources-usage