Skip to content

Commit a5cec7d

Browse files
authored
[chore] Make DOCKER_IS_PODMAN check more reliable in Makefile (#1983)
1 parent c01aa89 commit a5cec7d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Makefile

+12-3
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,20 @@ CHECK_TARGETS=install-tools markdownlint misspell table-check compatibility-chec
5252
schema-check check-file-and-folder-names-in-docs
5353

5454
# Determine if "docker" is actually podman
55-
DOCKER_IS_PODMAN=$(docker --version | grep podman | wc -l)
55+
DOCKER_VERSION_OUTPUT := $(shell docker --version 2>&1)
56+
DOCKER_IS_PODMAN := $(shell echo $(DOCKER_VERSION_OUTPUT) | grep -c podman)
57+
5658
ifeq ($(DOCKER_IS_PODMAN),0)
57-
DOCKER_COMMAND=docker
59+
DOCKER_COMMAND := docker
5860
else
59-
DOCKER_COMMAND=podman
61+
DOCKER_COMMAND := podman
62+
endif
63+
64+
# Debug printing
65+
ifdef DEBUG
66+
$(info Docker version output: $(DOCKER_VERSION_OUTPUT))
67+
$(info Is Docker actually Podman? $(DOCKER_IS_PODMAN))
68+
$(info Using command: $(DOCKER_COMMAND))
6069
endif
6170

6271
DOCKER_RUN=$(DOCKER_COMMAND) run

0 commit comments

Comments
 (0)