Skip to content

Commit 2d07a64

Browse files
committed
Change to single-arch build, separate build and push
1 parent f910aa3 commit 2d07a64

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

Makefile

+6-14
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ else
6666
GOBIN=$(shell $(GO) env GOBIN)
6767
endif
6868

69-
ifeq ($(IMAGE_PLATFORM),)
70-
IMAGE_PLATFORM=linux/$(shell $(GO) env GOARCH)
71-
endif
72-
7369
ifeq ($(CLUSTER_DNS),)
7470
# This makes sure that the "ingresscontroller" kind, which only exists on OpenShift by default, is only queried
7571
# when CLUSTER_DNS is not set.
@@ -513,7 +509,8 @@ docker/login/internal:
513509

514510
# Build the image
515511
image/build:
516-
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) buildx build -t $(SHORT_IMAGE_REF) . --load
512+
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) build -t $(SHORT_IMAGE_REF) .
513+
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) tag $(IMAGE_REF) $(SHORT_IMAGE_REF)
517514
@echo "New image tag: $(SHORT_IMAGE_REF). You might want to"
518515
@echo "export FLEET_MANAGER_IMAGE=$(SHORT_IMAGE_REF)"
519516
ifeq ("$(CLUSTER_TYPE)","kind")
@@ -557,16 +554,11 @@ image/push/emailsender: image/build/emailsender
557554
@echo "emailsender image was pushed as $(IMAGE_REF)."
558555
.PHONY: image/push/emailsender
559556

560-
# Build and push the image
561-
image/push: image/push/fleet-manager image/push/probe
562-
.PHONY: image/push
563-
564557
image/push/fleet-manager: IMAGE_REF="$(external_image_registry)/$(image_repository):$(image_tag)"
565-
image/push/fleet-manager:
566-
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) buildx build -t $(IMAGE_REF) --platform $(IMAGE_PLATFORM) --output "type=image,push=true" .
558+
image/push/fleet-manager: image/build
559+
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) push $(IMAGE_REF)
567560
@echo
568-
@echo "Image was pushed as $(IMAGE_REF). You might want to"
569-
@echo "export FLEET_MANAGER_IMAGE=$(IMAGE_REF)"
561+
@echo "Image was pushed as $(IMAGE_REF)."
570562
.PHONY: image/push/fleet-manager
571563

572564
image/push/probe: IMAGE_REF="$(external_image_registry)/$(probe_image_repository):$(image_tag)"
@@ -579,7 +571,7 @@ image/push/probe: image/build/probe
579571
# push the image to the OpenShift internal registry
580572
image/push/internal: IMAGE_TAG ?= $(image_tag)
581573
image/push/internal: docker/login/internal
582-
$(DOCKER) buildx build -t "$(shell oc get route default-route -n openshift-image-registry -o jsonpath="{.spec.host}")/$(NAMESPACE)/$(IMAGE_NAME):$(IMAGE_TAG)" --platform linux/amd64 --output "type=registry,push=true" .
574+
$(DOCKER) buildx build -t "$(shell oc get route default-route -n openshift-image-registry -o jsonpath="{.spec.host}")/$(NAMESPACE)/$(IMAGE_NAME):$(IMAGE_TAG)" --platform linux/amd64 --push .
583575
.PHONY: image/push/internal
584576

585577
image/build/fleetshard-operator: IMAGE_REF="$(external_image_registry)/fleetshard-operator:$(image_tag)"

0 commit comments

Comments
 (0)