diff --git a/Makefile b/Makefile index e2837ad..911f63d 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) @@ -52,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) .