Skip to content

Commit

Permalink
small refactor of platforms in Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: mluffman <[email protected]>
  • Loading branch information
mluffman committed Oct 17, 2024
1 parent 7fa2d7f commit 2278d09
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ GOBIN=$(shell go env GOBIN)
endif

CONTAINER_ENGINE ?= docker
PLATFORMS="linux/arm64,linux/amd64"

all: manager

Expand Down Expand Up @@ -76,15 +77,15 @@ generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

docker-create:
${CONTAINER_ENGINE} buildx create --platform "linux/amd64,linux/arm64" --use
${CONTAINER_ENGINE} buildx create --platform $(PLATFORMS) --use

# Build the docker image
docker-build:
${CONTAINER_ENGINE} buildx build --platform="linux/arm64,linux/amd64" -t ${IMG} .
${CONTAINER_ENGINE} buildx build --platform=$(PLATFORMS) -t ${IMG} .

# Push the docker image
docker-push:
${CONTAINER_ENGINE} buildx build --push --platform="linux/arm64,linux/amd64" -t ${IMG} .
${CONTAINER_ENGINE} buildx build --push --platform="$(PLATFORMS)" -t ${IMG} .

# Download controller-gen locally if necessary
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
Expand Down Expand Up @@ -121,7 +122,7 @@ bundle: manifests kustomize
# Build the bundle image.
.PHONY: bundle-build
bundle-build:
${CONTAINER_ENGINE} buildx build --platform="linux/arm64,linux/amd64" -f bundle.Dockerfile -t $(BUNDLE_IMG) .
${CONTAINER_ENGINE} buildx build --platform="$(PLATFORMS)" -f bundle.Dockerfile -t $(BUNDLE_IMG) .

# Generate bundle manifests and metadata, then validate generated files.
.PHONY: codegen
Expand Down

0 comments on commit 2278d09

Please sign in to comment.