Skip to content

Commit

Permalink
Add support for other container engines.
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Montague <thomas.montague@trmlabs.com>
  • Loading branch information
montaguethomas committed May 22, 2024
1 parent d15c80e commit 1e601f6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ else
GOBIN=$(shell go env GOBIN)
endif

CONTAINER_ENGINE ?= docker

all: manager

# Run tests
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
make deploy IMG=redis-operator:e2e

0 comments on commit 1e601f6

Please sign in to comment.