Skip to content

Commit 2336fdc

Browse files
authored
ci: Avoid printing "docker: not found" error messages (riscv#1916)
This could be fixed by adding `2>&1` to the `docker info` command, but it seems cleaner to correctly infer the value of SKIP_DOCKER and avoid entering the whole `ifneq ($(SKIP_DOCKER),true)` block.
1 parent 0a36d5f commit 2336fdc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
DOCS := riscv-privileged riscv-unprivileged
2323

2424
DATE ?= $(shell date +%Y-%m-%d)
25+
SKIP_DOCKER ?= $(shell if command -v docker >/dev/null 2>&1 ; then echo false; else echo true; fi)
2526
DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest
2627
ifneq ($(SKIP_DOCKER),true)
2728
DOCKER_IS_PODMAN = \
28-
$(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?)
29+
$(shell ! docker -v | grep podman >/dev/null ; echo $$?)
2930
ifeq "$(DOCKER_IS_PODMAN)" "1"
3031
# Modify the SELinux label for the host directory to indicate
3132
# that it can be shared with multiple containers. This is apparently
@@ -137,7 +138,7 @@ build: submodule-check
137138

138139
build-container: submodule-check
139140
@echo "Starting build inside Docker container..."
140-
$(MAKE) build-docs
141+
$(MAKE) SKIP_DOCKER=false build-docs
141142
@echo "Build completed successfully inside Docker container."
142143

143144
build-no-container: submodule-check

0 commit comments

Comments
 (0)