Skip to content

Commit

Permalink
add a default build platform for regular build command (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelsoccupied authored Dec 26, 2024
1 parent 563073f commit 552b62d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ run: manifests generate fmt vet binary ## Run a controller from your host.
# If you wish to build the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/

PLATFORM ?= linux/amd64
.PHONY: docker-build
docker-build: manifests generate fmt vet ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} -f Dockerfile --platform=$(PLATFORMS) --target ${DOCKER_TARGET} --build-arg "GOBUILD_GCFLAGS=${GOBUILD_GCFLAGS}" .
$(CONTAINER_TOOL) build -t ${IMG} -f Dockerfile --platform=$(PLATFORM) --target ${DOCKER_TARGET} --build-arg "GOBUILD_GCFLAGS=${GOBUILD_GCFLAGS}" .

.PHONY: docker-push
docker-push: docker-build ## Push docker image with the manager.
Expand Down

0 comments on commit 552b62d

Please sign in to comment.