File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Version
2
2
GIT_HEAD_COMMIT ?= $(shell git rev-parse --short HEAD)
3
3
VERSION ?= $(or $(shell git describe --abbrev=0 --tags --match "v* " 2>/dev/null) ,$(GIT_HEAD_COMMIT ) )
4
+ GO_OS ?= $(shell go env GOOS)
5
+ GO_ARCH ?= $(shell go env GOARCH)
4
6
5
7
# Defaults
6
8
REGISTRY ?= ghcr.io
@@ -39,6 +41,7 @@ dlv-build:
39
41
docker build . --build-arg " GCFLAGS=all=-N -l" --tag projectcapsule/capsule-proxy:dlv --target dlv
40
42
41
43
44
+ KO_PLATFORM ?= $(GOOS ) /$(GO_ARCH )
42
45
KOCACHE ?= /tmp/ko-cache
43
46
KO_TAGS ?= "latest"
44
47
@@ -60,9 +63,9 @@ LD_FLAGS := "-X main.Version=$(VERSION) \
60
63
61
64
.PHONY : ko-build-capsule-proxy
62
65
ko-build-capsule-proxy : ko
63
- @ echo Building Capsule Proxy $(KO_TAGS ) >&2
66
+ echo Building Capsule Proxy $(KO_TAGS ) for $( KO_PLATFORM ) >&2
64
67
@LD_FLAGS=$(LD_FLAGS ) KOCACHE=$(KOCACHE ) KO_DOCKER_REPO=$(CAPSULE_PROXY_IMG ) \
65
- $(KO ) build ./ --bare --tags=$(KO_TAGS ) --local --push=false
68
+ $(KO ) build ./ --bare --tags=$(KO_TAGS ) --local --push=false --platform= $( KO_PLATFORM )
66
69
67
70
.PHONY : ko-build-all
68
71
ko-build-all : ko-build-capsule-proxy
You can’t perform that action at this time.
0 commit comments