-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (29 loc) · 1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ifndef DOCKERIMAGE
DOCKERIMAGE := kube-dhcp:dev
endif
MANIFESTTOOL := $(GOPATH)/bin/manifest-tool
# Development build
.PHONY: build
build:
docker build -f Dockerfile.build --build-arg=GOARCH=$(shell go env GOARCH) -t $(DOCKERIMAGE) .
# Build all images for all archs.
.PHONY: all
all:
@${MAKE} -B DOCKERIMAGE=$(DOCKERIMAGE) GOARCH=amd64 build-arch
@${MAKE} -B DOCKERIMAGE=$(DOCKERIMAGE) GOARCH=arm build-arch
@${MAKE} -B DOCKERIMAGE=$(DOCKERIMAGE) GOARCH=arm64 build-arch
.PHONY: build-arch
build-arch:
docker build -f Dockerfile.build --build-arg=GOARCH=$(GOARCH) -t $(DOCKERIMAGE)-$(GOARCH) .
docker push $(DOCKERIMAGE)-$(GOARCH)
$(MANIFESTTOOL):
go get github.com/estesp/manifest-tool
.PHONY: push-manifest
push-manifest: $(MANIFESTTOOL)
@$(MANIFESTTOOL) $(MANIFESTAUTH) push from-args \
--platforms linux/amd64,linux/arm,linux/arm64 \
--template $(DOCKERIMAGE)-ARCH \
--target $(DOCKERIMAGE)
.PHONY: release
release:
@${MAKE} -B DOCKERIMAGE=pulcy/$(shell pulsar docker-tag) all push-manifest