Make the container engine configurable in OLM packaging
Everything works with either Docker or Podman.
CCP_IMAGE_PREFIX ?= registry.developers.crunchydata.com/crunchydata
CCP_PG_FULLVERSION ?= 12.4
CCP_POSTGIS_VERSION ?= 3.0
+CONTAINER ?= docker
KUBECONFIG ?= $(HOME)/.kube/config
OLM_SDK_VERSION ?= 0.15.1
OLM_TOOLS ?= registry.localhost:5000/postgres-operator-olm-tools:$(OLM_SDK_VERSION)
@@ -15,7 +16,7 @@ PGO_IMAGE_TAG ?= $(PGO_BASEOS)-$(PGO_VERSION)
CCP_IMAGE_TAG ?= $(PGO_BASEOS)-$(CCP_PG_FULLVERSION)-$(PGO_VERSION)
CCP_POSTGIS_IMAGE_TAG ?= $(PGO_BASEOS)-$(CCP_PG_FULLVERSION)-$(CCP_POSTGIS_VERSION)-$(PGO_VERSION)
-OLM_TOOLS_BASH = docker run --net=host --rm --tty $(DOCKER_ARGS) \
+OLM_TOOLS_BASH = $(CONTAINER) run --net=host --rm --tty $(CONTAINER_ARGS) \
--mount 'type=bind,source=$(KUBECONFIG),target=/root/.kube/config,ro' \
--mount 'type=bind,source=$(CURDIR)/..,target=/mnt/installers' \
--workdir '/mnt/installers/$(basename $(notdir $(CURDIR)))' \
@@ -47,7 +48,7 @@ docker-package: ## Build package and version bundle from inside a container
.PHONY: docker-shell
docker-shell: image-tools
-docker-shell: DOCKER_ARGS = --interactive
+docker-shell: CONTAINER_ARGS = --interactive
docker-shell: ## Start a shell inside a container with all the tools needed to build and test
$(OLM_TOOLS_BASH)
@@ -62,7 +63,7 @@ help: ## Print this message
.PHONY: image-tools
image-tools:
- docker build --file Dockerfile --tag '$(OLM_TOOLS)' --build-arg OLM_SDK_VERSION='$(OLM_SDK_VERSION)' .
+ $(CONTAINER) build --file Dockerfile --tag '$(OLM_TOOLS)' --build-arg OLM_SDK_VERSION='$(OLM_SDK_VERSION)' .
.PHONY: install
install: ## Install the package in a Kubernetes namespace
