Skip to content

Commit a4add9d

Browse files
committed
fix(build): Make docker-buildx target compatible with podman
Signed-off-by: Kristian Da Costa Menezes <[email protected]>
1 parent b5dd67a commit a4add9d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,18 @@ docker-push: ## Push docker image with the manager.
189189
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
190190
.PHONY: docker-buildx
191191
docker-buildx: ## Build and push docker image for the manager for cross-platform support
192+
ifeq ($(CONTAINER_TOOL),podman)
193+
$(CONTAINER_TOOL) build --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile .
194+
$(CONTAINER_TOOL) push ${IMG}
195+
else
192196
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
193197
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
194198
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
195199
$(CONTAINER_TOOL) buildx use project-v3-builder
196200
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
197201
- $(CONTAINER_TOOL) buildx rm project-v3-builder
198202
rm Dockerfile.cross
203+
endif
199204

200205
.PHONY: build-installer
201206
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.

0 commit comments

Comments
 (0)