From df43b08b043192c9f2f8dd2b95be6403644af70c Mon Sep 17 00:00:00 2001 From: Devon Bautista Date: Mon, 25 Mar 2024 15:17:26 -0600 Subject: [PATCH 1/2] Add ability to set GOOS and GOARCH (default to linux/amd64 for container image) --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e2837ad..c99be72 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,8 @@ NAME ?= bss VERSION ?= $(shell cat .version) BINARIES = boot-script-service bss-init +GOOS := $(if $(GOOS),$(GOOS),linux) +GOARCH := $(if $(GOARCH),$(GOARCH),amd64) all : image unittest ct snyk ct_image @@ -31,7 +33,7 @@ all : image unittest ct snyk ct_image binaries: $(BINARIES) %: cmd/%/*.go - GOOS=linux GOARCH=amd64 go build -v -tags musl $(LDFLAGS) -o $@ ./$(dir $<) + GOOS=$(GOOS) GOARCH=$(GOARCH) go build -v -tags musl $(LDFLAGS) -o $@ ./$(dir $<) clean: rm -f $(BINARIES) From 81312f8f633b96b97f40b581487938383bb563c2 Mon Sep 17 00:00:00 2001 From: Devon Bautista Date: Mon, 25 Mar 2024 15:18:08 -0600 Subject: [PATCH 2/2] Add DOCKEROPTS make variable --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c99be72..911f63d 100644 --- a/Makefile +++ b/Makefile @@ -54,4 +54,4 @@ ct_image: docker build --no-cache -f test/ct/Dockerfile test/ct/ --tag hms-bss-hmth-test:${VERSION} docker: $(BINARIES) - docker build --tag openchami/bss:v$(VERSION)-dirty . + docker build --tag openchami/bss:v$(VERSION)-dirty $(DOCKEROPTS) .