1- IMG ?= linode/linode-cloud-controller-manager:canary
1+ KO_DOCKER_REPO ?= docker.io/linode/linode-cloud-controller-manager
2+ IMAGE_TAGS ?= canary
3+ IMG ?= $(KO_DOCKER_REPO ) :canary
24RELEASE_DIR ?= release
35PLATFORM ?= linux/amd64
46
@@ -95,23 +97,20 @@ release:
9597 tar -czvf ./$(RELEASE_DIR ) /helm-chart-$(IMAGE_VERSION ) .tgz -C ./deploy/chart .
9698
9799.PHONY : imgname
98- # print the Docker image name that will be used
100+ # print the container image name that will be used
99101# useful for subsequently defining it on the shell
100102imgname :
101103 echo IMG=${IMG}
102104
103- .PHONY : docker -build
104- # we cross compile the binary for linux, then build a container
105- docker -build : build-linux
106- DOCKER_BUILDKIT=1 docker build --platform= $( PLATFORM ) --tag ${IMG} .
105+ .PHONY : ko -build
106+ # build the container image locally without pushing it to a registry
107+ ko -build :
108+ CGO_ENABLED=0 ko build --local --bare --tags " $( IMAGE_TAGS ) " --platform= $( PLATFORM ) .
107109
108- .PHONY : docker-push
109- # must run the docker build before pushing the image
110- docker-push :
111- docker push ${IMG}
112-
113- .PHONY : build-and-push
114- build-and-push : docker-build docker-push
110+ .PHONY : ko-publish
111+ # build the container image and publish it to the registry named by IMG
112+ ko-publish :
113+ CGO_ENABLED=0 KO_DOCKER_REPO=" $( KO_DOCKER_REPO) " ko build --bare --tags " $( IMAGE_TAGS) " --platform=$(PLATFORM ) .
115114
116115.PHONY : run
117116# run the ccm locally, really only makes sense on linux anyway
@@ -135,7 +134,7 @@ run-debug: build
135134# ####################################################################
136135
137136.PHONY : mgmt-and-capl-cluster
138- mgmt-and-capl-cluster : build-and-push mgmt-cluster
137+ mgmt-and-capl-cluster : ko-publish mgmt-cluster
139138 $(MAKE ) -j2 capl-ipv6-cluster capl-cluster
140139
141140.PHONY : capl-cluster
0 commit comments