Skip to content

Commit e021986

Browse files
build: add support for other container engines (#947)
Add support for other container engines. Signed-off-by: Thomas Montague <thomas.montague@trmlabs.com>
1 parent d15c80e commit e021986

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ else
2323
GOBIN=$(shell go env GOBIN)
2424
endif
2525

26+
CONTAINER_ENGINE ?= docker
27+
2628
all: manager
2729

2830
# Run tests
@@ -74,15 +76,15 @@ generate: controller-gen
7476
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
7577

7678
docker-create:
77-
docker buildx create --platform "linux/amd64,linux/arm64" --use
79+
${CONTAINER_ENGINE} buildx create --platform "linux/amd64,linux/arm64" --use
7880

7981
# Build the docker image
8082
docker-build:
81-
docker buildx build --platform="linux/arm64,linux/amd64" -t ${IMG} .
83+
${CONTAINER_ENGINE} buildx build --platform="linux/arm64,linux/amd64" -t ${IMG} .
8284

8385
# Push the docker image
8486
docker-push:
85-
docker buildx build --push --platform="linux/arm64,linux/amd64" -t ${IMG} .
87+
${CONTAINER_ENGINE} buildx build --push --platform="linux/arm64,linux/amd64" -t ${IMG} .
8688

8789
# Download controller-gen locally if necessary
8890
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
@@ -119,7 +121,7 @@ bundle: manifests kustomize
119121
# Build the bundle image.
120122
.PHONY: bundle-build
121123
bundle-build:
122-
docker buildx build --platform="linux/arm64,linux/amd64" -f bundle.Dockerfile -t $(BUNDLE_IMG) .
124+
${CONTAINER_ENGINE} buildx build --platform="linux/arm64,linux/amd64" -f bundle.Dockerfile -t $(BUNDLE_IMG) .
123125

124126
# Generate bundle manifests and metadata, then validate generated files.
125127
.PHONY: codegen
@@ -164,7 +166,7 @@ install-kuttl:
164166

165167
.PHONY: e2e-kind-setup
166168
e2e-kind-setup:
167-
docker build -t redis-operator:e2e -f Dockerfile .
169+
${CONTAINER_ENGINE} build -t redis-operator:e2e -f Dockerfile .
168170
kind create cluster --config tests/_config/kind-config.yaml
169171
kind load docker-image redis-operator:e2e --name kind
170-
make deploy IMG=redis-operator:e2e
172+
make deploy IMG=redis-operator:e2e

0 commit comments

Comments
 (0)