From b2c0703927910f6334da5d4098f847d0556a5fa7 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 10 Dec 2024 13:43:02 +0800 Subject: Update Makefile to build with docker/podman See also: PR #22 --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7d7db85..c656b8b 100644 --- a/Makefile +++ b/Makefile @@ -37,3 +37,20 @@ cleanall: done .PHONY: all en zh dist clean cleanall + +DOCKER_CLI?= sudo docker +DOCKER_IMAGE:= resume:builder +DOCKER_CHOWN:= chown -R $(shell id -u):$(shell id -g) . + +# build the resume within an docker container +docker: + $(DOCKER_CLI) image inspect -f 'ok' $(DOCKER_IMAGE) 2>/dev/null || \ + $(DOCKER_CLI) build --tag $(DOCKER_IMAGE) -f Dockerfile + $(DOCKER_CLI) run --rm --volume $(PWD):/build $(DOCKER_IMAGE) \ + sh -c "cd /build && make clean && make && $(DOCKER_CHOWN)" + +podman: DOCKER_CLI=podman +podman: DOCKER_CHOWN=: +podman: docker + +.PHONY: docker podman -- cgit v1.2.2