Skip to content

Commit

Permalink
Change to single-arch build, separate build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
ebensh committed Jun 28, 2024
1 parent f910aa3 commit 26bb920
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ else
GOBIN=$(shell $(GO) env GOBIN)
endif

ifeq ($(IMAGE_PLATFORM),)
IMAGE_PLATFORM=linux/$(shell $(GO) env GOARCH)
endif

ifeq ($(CLUSTER_DNS),)
# This makes sure that the "ingresscontroller" kind, which only exists on OpenShift by default, is only queried
# when CLUSTER_DNS is not set.
Expand Down Expand Up @@ -513,7 +509,8 @@ docker/login/internal:

# Build the image
image/build:
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) buildx build -t $(SHORT_IMAGE_REF) . --load
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) build -t $(SHORT_IMAGE_REF) .
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) tag $(IMAGE_REF) $(SHORT_IMAGE_REF)
@echo "New image tag: $(SHORT_IMAGE_REF). You might want to"
@echo "export FLEET_MANAGER_IMAGE=$(SHORT_IMAGE_REF)"
ifeq ("$(CLUSTER_TYPE)","kind")
Expand Down Expand Up @@ -557,16 +554,11 @@ image/push/emailsender: image/build/emailsender
@echo "emailsender image was pushed as $(IMAGE_REF)."
.PHONY: image/push/emailsender

# Build and push the image
image/push: image/push/fleet-manager image/push/probe
.PHONY: image/push

image/push/fleet-manager: IMAGE_REF="$(external_image_registry)/$(image_repository):$(image_tag)"
image/push/fleet-manager:
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) buildx build -t $(IMAGE_REF) --platform $(IMAGE_PLATFORM) --output "type=image,push=true" .
image/push/fleet-manager: image/build
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) push $(IMAGE_REF)
@echo
@echo "Image was pushed as $(IMAGE_REF). You might want to"
@echo "export FLEET_MANAGER_IMAGE=$(IMAGE_REF)"
@echo "Image was pushed as $(IMAGE_REF)."
.PHONY: image/push/fleet-manager

image/push/probe: IMAGE_REF="$(external_image_registry)/$(probe_image_repository):$(image_tag)"
Expand Down

0 comments on commit 26bb920

Please sign in to comment.