From 5e43e1fefad275b395cfe08ef5b15cf8ac9a7d61 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 13 Mar 2019 15:21:48 -0400 Subject: [PATCH] makefile: use a variable to choose "docker" command This change allows the use of alternatives to or wrappers around the normal docker command for container builds. Example 1: make image-rbdplugin CONTAINER_CMD=podman Example 2: CONTAINER_CMD=podman make image-rbdplugin Signed-off-by: John Mulligan --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 825ed8b66..11b1a67fc 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ .PHONY: all rbdplugin cephfsplugin +CONTAINER_CMD?=docker + RBD_IMAGE_NAME=$(if $(ENV_RBD_IMAGE_NAME),$(ENV_RBD_IMAGE_NAME),quay.io/cephcsi/rbdplugin) RBD_IMAGE_VERSION=$(if $(ENV_RBD_IMAGE_VERSION),$(ENV_RBD_IMAGE_VERSION),v1.0.0) @@ -40,7 +42,7 @@ rbdplugin: image-rbdplugin: rbdplugin cp _output/rbdplugin deploy/rbd/docker - docker build -t $(RBD_IMAGE_NAME):$(RBD_IMAGE_VERSION) deploy/rbd/docker + $(CONTAINER_CMD) build -t $(RBD_IMAGE_NAME):$(RBD_IMAGE_VERSION) deploy/rbd/docker cephfsplugin: if [ ! -d ./vendor ]; then dep ensure -vendor-only; fi @@ -48,13 +50,13 @@ cephfsplugin: image-cephfsplugin: cephfsplugin cp _output/cephfsplugin deploy/cephfs/docker - docker build -t $(CEPHFS_IMAGE_NAME):$(CEPHFS_IMAGE_VERSION) deploy/cephfs/docker + $(CONTAINER_CMD) build -t $(CEPHFS_IMAGE_NAME):$(CEPHFS_IMAGE_VERSION) deploy/cephfs/docker push-image-rbdplugin: image-rbdplugin - docker push $(RBD_IMAGE_NAME):$(RBD_IMAGE_VERSION) + $(CONTAINER_CMD) push $(RBD_IMAGE_NAME):$(RBD_IMAGE_VERSION) push-image-cephfsplugin: image-cephfsplugin - docker push $(CEPHFS_IMAGE_NAME):$(CEPHFS_IMAGE_VERSION) + $(CONTAINER_CMD) push $(CEPHFS_IMAGE_NAME):$(CEPHFS_IMAGE_VERSION) clean: go clean -r -x