Skip to content

Commit

Permalink
use docker to cross-compile
Browse files Browse the repository at this point in the history
  • Loading branch information
alphanota committed Jan 10, 2025
1 parent 03b5a44 commit 18a6e09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ $(BUILD_DIR)/$(PROJECT)-%: $(EMBEDDED_FILES_CHECK) $(GO_FILES) $(BUILD_DIR)
$(eval arch = $(lastword $(subst -, ,$(subst .exe,,$*))))
$(eval ldflags = $(GO_LDFLAGS) $(patsubst %,'-extldflags %',$(LDFLAGS_$(os))))
$(eval tags = $(GO_BUILD_TAGS) $(GO_BUILD_TAGS_$(os)) $(GO_BUILD_TAGS_$(os)_$(arch)))
GOOS=$(os) GOARCH=$(arch) CGO_ENABLED=1 go build -v -mod="vendor" -tags "$(tags)" -ldflags "$(ldflags)" -o $@ ./cmd/skaffold
docker run --rm -v ${PWD}:/skaffold -w /skaffold -e GOOS=$(os) -e GOARCH=$(arch) -e CGO_ENABLED=1 golang:1.23.4 go build -v -mod="vendor" -tags "$(tags)" -ldflags "$(ldflags)" -o $@ ./cmd/skaffold
(cd `dirname $@`; shasum -a 256 `basename $@`) | tee $@.sha256
file $@ || true

Expand Down

0 comments on commit 18a6e09

Please sign in to comment.