From e021986de8bf46fa3fb2743e51454a20db1ceeac Mon Sep 17 00:00:00 2001 From: Thomas Montague Date: Wed, 22 May 2024 21:25:51 -0500 Subject: [PATCH] build: add support for other container engines (#947) Add support for other container engines. Signed-off-by: Thomas Montague --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 110a2626c..5bb014d7a 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,8 @@ else GOBIN=$(shell go env GOBIN) endif +CONTAINER_ENGINE ?= docker + all: manager # Run tests @@ -74,15 +76,15 @@ generate: controller-gen $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." docker-create: - docker buildx create --platform "linux/amd64,linux/arm64" --use + ${CONTAINER_ENGINE} buildx create --platform "linux/amd64,linux/arm64" --use # Build the docker image docker-build: - docker buildx build --platform="linux/arm64,linux/amd64" -t ${IMG} . + ${CONTAINER_ENGINE} buildx build --platform="linux/arm64,linux/amd64" -t ${IMG} . # Push the docker image docker-push: - docker buildx build --push --platform="linux/arm64,linux/amd64" -t ${IMG} . + ${CONTAINER_ENGINE} buildx build --push --platform="linux/arm64,linux/amd64" -t ${IMG} . # Download controller-gen locally if necessary CONTROLLER_GEN = $(shell pwd)/bin/controller-gen @@ -119,7 +121,7 @@ bundle: manifests kustomize # Build the bundle image. .PHONY: bundle-build bundle-build: - docker buildx build --platform="linux/arm64,linux/amd64" -f bundle.Dockerfile -t $(BUNDLE_IMG) . + ${CONTAINER_ENGINE} buildx build --platform="linux/arm64,linux/amd64" -f bundle.Dockerfile -t $(BUNDLE_IMG) . # Generate bundle manifests and metadata, then validate generated files. .PHONY: codegen @@ -164,7 +166,7 @@ install-kuttl: .PHONY: e2e-kind-setup e2e-kind-setup: - docker build -t redis-operator:e2e -f Dockerfile . + ${CONTAINER_ENGINE} build -t redis-operator:e2e -f Dockerfile . kind create cluster --config tests/_config/kind-config.yaml kind load docker-image redis-operator:e2e --name kind - make deploy IMG=redis-operator:e2e \ No newline at end of file + make deploy IMG=redis-operator:e2e