Skip to content

Commit 4dd7d59

Browse files
feat: add support for Podman as a container runtime (#464)
Since docker requires a license in some scenarios, we might have contributors who prefer to use Podman. This commit introduces the changes necessary to support both.
1 parent 55689e8 commit 4dd7d59

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ ifeq ($(shell [[ $$HOME == "" || $$HOME == "/" ]] && [[ $$XDG_DATA_HOME == "" ]]
2525
SETUP_ENVTEST_BIN_DIR_OVERRIDE += --bin-dir /tmp/envtest-binaries
2626
endif
2727

28+
ifneq (, $(shell command -v docker 2>/dev/null))
29+
CONTAINER_RUNTIME := docker
30+
else ifneq (, $(shell command -v podman 2>/dev/null))
31+
CONTAINER_RUNTIME := podman
32+
else
33+
$(warning Could not find docker or podman in path! This may result in targets requiring a container runtime failing!)
34+
endif
35+
2836
# For standard development and release flows, we use the config/overlays/cert-manager overlay.
2937
KUSTOMIZE_OVERLAY := config/overlays/cert-manager
3038

@@ -200,7 +208,7 @@ run: generate kind-cluster install ## Create a kind cluster and install a local
200208

201209
.PHONY: build-container
202210
build-container: build-linux ## Build docker image for catalogd.
203-
docker build -f Dockerfile -t $(IMAGE) bin/linux
211+
$(CONTAINER_RUNTIME) build -f Dockerfile -t $(IMAGE) ./bin/linux
204212

205213
##@ Deploy
206214

@@ -215,7 +223,7 @@ kind-cluster-cleanup: $(KIND) ## Delete the kind cluster
215223

216224
.PHONY: kind-load
217225
kind-load: check-cluster $(KIND) ## Load the built images onto the local cluster
218-
docker save $(IMAGE) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
226+
$(CONTAINER_RUNTIME) save $(IMAGE) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
219227

220228
.PHONY: install
221229
install: check-cluster build-container kind-load deploy wait ## Install local catalogd to an existing cluster

0 commit comments

Comments
 (0)