Skip to content

Commit 6855cb2

Browse files
Merge pull request #9 from sharifelgamal/multiarch
change makefile to support multiarch docker manifest
2 parents fc06a87 + 6f205d9 commit 6855cb2

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Makefile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
REGISTRY?=gcr.io/k8s-minikube
22
VERSION=v0.0.3
3+
GOOS?=$(shell go env GOOS)
34

4-
build:
5-
CGO_ENABLED=0 GOOS=linux go build -o out/gcp-auth-webhook -ldflags=$(PROVISIONER_LDFLAGS) server.go
5+
build: ## Build the gcp-auth-webhook binary
6+
CGO_ENABLED=0 GOOS=linux go build -o out/gcp-auth-webhook server.go
67

78
.PHONY: image
8-
image: build
9-
docker build -t $(REGISTRY)/gcp-auth-webhook:$(VERSION) -f Dockerfile ./out
10-
11-
12-
.PHONY: push
13-
push: image
14-
docker push $(REGISTRY)/gcp-auth-webhook:$(VERSION)
15-
9+
image: build ## Create and push multiarch manifest and images
10+
curl -L https://github.com/google/ko/releases/download/v0.8.0/ko_0.8.0_$(GOOS)_x86_64.tar.gz | tar xzf - ko && chmod +x ./ko
11+
KO_DOCKER_REPO=$(REGISTRY) ./ko publish -B . --platform all -t $(VERSION)
12+
rm ./ko

0 commit comments

Comments
 (0)