diff --git a/internal/plugins/helm/v1/scaffolds/internal/templates/makefile.go b/internal/plugins/helm/v1/scaffolds/internal/templates/makefile.go index 9bc0584ee95..a008c398745 100644 --- a/internal/plugins/helm/v1/scaffolds/internal/templates/makefile.go +++ b/internal/plugins/helm/v1/scaffolds/internal/templates/makefile.go @@ -96,11 +96,11 @@ run: helm-operator ## Run against the configured Kubernetes cluster in ~/.kube/c .PHONY: docker-build docker-build: ## Build docker image with the manager. - docker build -t ${IMG} . + $(CONTAINER_TOOL) build -t ${IMG} . .PHONY: docker-push docker-push: ## Push docker image with the manager. - docker push ${IMG} + $(CONTAINER_TOOL) push ${IMG} ##@ Deployment diff --git a/internal/plugins/manifests/v2/init.go b/internal/plugins/manifests/v2/init.go index 772d00e90de..3ed947463d4 100644 --- a/internal/plugins/manifests/v2/init.go +++ b/internal/plugins/manifests/v2/init.go @@ -168,6 +168,10 @@ USE_IMAGE_DIGESTS ?= false ifeq ($(USE_IMAGE_DIGESTS), true) BUNDLE_GEN_FLAGS += --use-image-digests endif + +# CONTAINER_TOOL defines the container tool to be used for building images. +# You can use docker or podman +CONTAINER_TOOL ?= docker ` makefileBundleFragmentGo = ` @@ -191,7 +195,7 @@ bundle: kustomize ## Generate bundle manifests and metadata, then validate gener makefileBundleBuildPushFragment = ` .PHONY: bundle-build bundle-build: ## Build the bundle image. - docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) . + $(CONTAINER_TOOL) build -f bundle.Dockerfile -t $(BUNDLE_IMG) . .PHONY: bundle-push bundle-push: ## Push the bundle image. @@ -253,7 +257,7 @@ endif # https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator .PHONY: catalog-build catalog-build: opm ## Build a catalog image. - $(OPM) index add --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) + $(OPM) index add --container-tool $(CONTAINER_TOOL) --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) # Push the catalog image. .PHONY: catalog-push