Skip to content

Commit

Permalink
Fix Docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi authored Nov 17, 2024
1 parent 781f804 commit 8824094
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
VERSION=$(shell git describe --tags --always --dirty)
LDFLAGS=-ldflags "-X main.version=$(VERSION)"
OSARCH=$(shell go env GOHOSTOS)-$(shell go env GOHOSTARCH)
CGO_ENABLED=1

SCEPCLIENT=\
scepclient-linux-amd64 \
Expand All @@ -23,12 +24,13 @@ my: scepclient-$(OSARCH) scepserver-$(OSARCH)
win: scepclient-$(OSARCH).exe scepserver-$(OSARCH).exe

docker: scepclient-linux-amd64 scepserver-linux-amd64
CGO_ENABLED=0

$(SCEPCLIENT):
GOOS=$(word 2,$(subst -, ,$@)) GOARCH=$(word 3,$(subst -, ,$(subst .exe,,$@))) go build $(LDFLAGS) -o $@ ./cmd/scepclient
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(word 2,$(subst -, ,$@)) GOARCH=$(word 3,$(subst -, ,$(subst .exe,,$@))) go build $(LDFLAGS) -o $@ ./cmd/scepclient

$(SCEPSERVER):
GOOS=$(word 2,$(subst -, ,$@)) GOARCH=$(word 3,$(subst -, ,$(subst .exe,,$@))) go build $(LDFLAGS) -o $@ ./cmd/scepserver
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(word 2,$(subst -, ,$@)) GOARCH=$(word 3,$(subst -, ,$(subst .exe,,$@))) go build $(LDFLAGS) -o $@ ./cmd/scepserver

%-$(VERSION).zip: %.exe
rm -f $@
Expand Down

0 comments on commit 8824094

Please sign in to comment.