diff --git a/Makefile b/Makefile index 5bf6a90..1f98267 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ docs-serve: ## Preview the documentation .PHONY: compile .compile: mkdir -p dependencies - $(COMMODORE_CMD) + $(COMPILE_CMD) .PHONY: test test: commodore_args += -f tests/$(instance).yml diff --git a/Makefile.vars.mk b/Makefile.vars.mk index c353f73..abda97f 100644 --- a/Makefile.vars.mk +++ b/Makefile.vars.mk @@ -12,8 +12,14 @@ root_volume ?= -v "$${PWD}:/$(COMPONENT_NAME)" compiled_volume ?= -v "$${PWD}/$(compiled_path):/$(COMPONENT_NAME)" commodore_args ?= --search-paths ./dependencies --search-paths . -DOCKER_CMD ?= docker -DOCKER_ARGS ?= run --rm -u "$$(id -u):$$(id -g)" -w /$(COMPONENT_NAME) -e HOME="/$(COMPONENT_NAME)" +ifneq "$(shell which docker 2>/dev/null)" "" + DOCKER_CMD ?= $(shell which docker) + DOCKER_USERNS ?= "" +else + DOCKER_CMD ?= podman + DOCKER_USERNS ?= keep-id +endif +DOCKER_ARGS ?= run --rm -u "$$(id -u):$$(id -g)" --userns=$(DOCKER_USERNS) -w /$(COMPONENT_NAME) -e HOME="/$(COMPONENT_NAME)" JSONNET_FILES ?= $(shell find . -type f -not -path './vendor/*' \( -name '*.*jsonnet' -or -name '*.libsonnet' \)) JSONNETFMT_ARGS ?= --in-place --pad-arrays @@ -30,7 +36,8 @@ VALE_ARGS ?= --minAlertLevel=error --config=/pages/ROOT/pages/.vale.ini /pages ANTORA_PREVIEW_CMD ?= $(DOCKER_CMD) run --rm --publish 35729:35729 --publish 2020:2020 --volume "${PWD}/.git":/preview/antora/.git --volume "${PWD}/docs":/preview/antora/docs docker.io/vshn/antora-preview:3.0.1.1 --style=syn --antora=docs -COMMODORE_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) docker.io/projectsyn/commodore:latest component compile . $(commodore_args) +COMMODORE_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) docker.io/projectsyn/commodore:latest +COMPILE_CMD ?= $(COMMODORE_CMD) component compile . $(commodore_args) JB_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) --entrypoint /usr/local/bin/jb docker.io/projectsyn/commodore:latest install instance ?= defaults