Skip to content

Commit

Permalink
Added CONTAINER_TOOL to set container tool for operator build (operat…
Browse files Browse the repository at this point in the history
…or-framework#6089)

Signed-off-by: Stanislav Ulrych <stanislav.ulrych@getmanta.com>
  • Loading branch information
stanislavulrych authored and Stanislav Ulrych committed Oct 17, 2022
1 parent 5e1fb9d commit 340fa6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions internal/plugins/manifests/v2/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 340fa6c

Please sign in to comment.