Skip to content

Commit 962e68e

Browse files
committed
Allow to use different binary for docker
Also canonicalize the image URL. This allows to use podman.
1 parent 8eafb1f commit 962e68e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ DOCS := \
1818
DATE ?= $(shell date +%Y-%m-%d)
1919
VERSION ?= v0.0.0
2020
REVMARK ?= Draft
21-
DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest
21+
DOCKER_IMG := docker.io/riscvintl/riscv-docs-base-container-image:latest
22+
DOCKER_BIN ?= docker
2223
ifneq ($(SKIP_DOCKER),true)
2324
DOCKER_IS_PODMAN = \
24-
$(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?)
25+
$(shell ! ${DOCKER_BIN} -v 2>&1 | grep podman >/dev/null ; echo $$?)
2526
ifeq "$(DOCKER_IS_PODMAN)" "1"
2627
DOCKER_VOL_SUFFIX = :z
2728
endif
2829

2930
DOCKER_CMD := \
30-
docker run --rm \
31+
${DOCKER_BIN} run --rm \
3132
-v ${PWD}:/build${DOCKER_VOL_SUFFIX} \
3233
-w /build \
3334
${DOCKER_IMG} \
@@ -76,7 +77,7 @@ vpath %.adoc $(SRC_DIR)
7677

7778
build:
7879
@echo "Checking if Docker is available..."
79-
@if command -v docker >/dev/null 2>&1 ; then \
80+
@if command -v ${DOCKER_BIN} >/dev/null 2>&1 ; then \
8081
echo "Docker is available, building inside Docker container..."; \
8182
$(MAKE) build-container; \
8283
else \
@@ -96,7 +97,7 @@ build-no-container:
9697

9798
# Update docker image to latest
9899
docker-pull-latest:
99-
docker pull ${DOCKER_IMG}
100+
${DOCKER_BIN} pull ${DOCKER_IMG}
100101

101102
clean:
102103
@echo "Cleaning up generated files..."

0 commit comments

Comments
 (0)