makefile: automatically select docker or podman container tools

After having forgot to explicitly pass CONTAINER_CMD for the millionth
time I figured copying ceph-csi a smidgen and automatically selecting
podman or docker based on availability would be save me some typing.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-06-09 16:13:10 -04:00 committed by John Mulligan
parent 68f8ce2fee
commit 38e9b9a260
1 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,5 @@
CI_IMAGE_NAME = go-ceph-ci
CONTAINER_CMD := docker
CONTAINER_CMD ?=
CONTAINER_OPTS := --security-opt $(shell grep -q selinux /sys/kernel/security/lsm && echo "label=disable" || echo "apparmor:unconfined")
CONTAINER_CONFIG_DIR := testing/containers/ceph
VOLUME_FLAGS :=
@ -8,6 +8,13 @@ RESULTS_DIR :=
CHECK_GOFMT_FLAGS := -e -s -l
IMPLEMENTS_OPTS :=
ifeq ($(CONTAINER_CMD),)
CONTAINER_CMD:=$(shell docker version >/dev/null 2>&1 && echo docker)
endif
ifeq ($(CONTAINER_CMD),)
CONTAINER_CMD:=$(shell podman version >/dev/null 2>&1 && echo podman)
endif
# the full name of the marker file including the ceph version
BUILDFILE=.build.$(CEPH_VERSION)