Skip to content

Commit 56fa397

Browse files
authored
CLOUDP-323996: Fix make multiarch image (#2382)
* CLOUDP-323996: Fix make multiarch image * Have both simple dev and multi-arch image
1 parent f7206b0 commit 56fa397

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,21 @@ bundle: manifests ## Generate bundle manifests and metadata, then validate gene
321321
operator-sdk bundle validate ./bundle
322322

323323
.PHONY: image
324-
image: ## Build the operator image
324+
image: ## Build an operator image for local development
325325
$(MAKE) bin/linux/amd64/manager TARGET_OS=linux TARGET_ARCH=amd64 VERSION=$(VERSION)
326326
$(MAKE) bin/linux/arm64/manager TARGET_OS=linux TARGET_ARCH=arm64 VERSION=$(VERSION)
327327
$(CONTAINER_ENGINE) build -f fast.Dockerfile --build-arg VERSION=$(VERSION) -t $(OPERATOR_IMAGE) .
328328
$(CONTAINER_ENGINE) push $(OPERATOR_IMAGE)
329329

330+
.PHONY: image-multiarch
331+
image-multiarch: ## Build releaseable multi-architecture operator image
332+
$(MAKE) bin/linux/amd64/manager TARGET_OS=linux TARGET_ARCH=amd64 VERSION=$(VERSION)
333+
$(MAKE) bin/linux/arm64/manager TARGET_OS=linux TARGET_ARCH=arm64 VERSION=$(VERSION)
334+
$(CONTAINER_ENGINE) buildx create --use --name multiarch-builder \
335+
--driver docker-container --bootstrap || echo "reusing multiarch-builder"
336+
$(CONTAINER_ENGINE) buildx build --platform linux/amd64,linux/arm64 --push \
337+
-f fast.Dockerfile --build-arg VERSION=$(VERSION) -t $(OPERATOR_IMAGE) .
338+
330339
.PHONY: bundle-build
331340
bundle-build: ## Build the bundle image.
332341
$(CONTAINER_ENGINE) build -f bundle.Dockerfile -t $(BUNDLE_IMG) .

fast.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# TODO: Eventually replace main Dockerfile
2-
FROM golang:1.24 as certs-source
2+
FROM golang:1.24 AS certs-source
33
ARG GOTOOLCHAIN=auto
44

55
# Using rolling tag to stay on latest UBI 9
6-
FROM registry.access.redhat.com/ubi9/ubi:latest as ubi-certs
6+
FROM registry.access.redhat.com/ubi9/ubi:latest AS ubi-certs
77
FROM registry.access.redhat.com/ubi9/ubi-micro:latest
88

99
ARG TARGETOS

0 commit comments

Comments
 (0)