diff options
author | Aaron LI <aly@aaronly.me> | 2024-12-10 13:43:02 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2024-12-10 13:43:22 +0800 |
commit | b2c0703927910f6334da5d4098f847d0556a5fa7 (patch) | |
tree | cc8681dae7d6bbedd25d85904dbe3dc71fbf796f /Makefile | |
parent | b4b446d0acc96f3b30b1d45bae378d13938fd667 (diff) | |
download | resume-b2c0703927910f6334da5d4098f847d0556a5fa7.tar.bz2 |
Update Makefile to build with docker/podman
See also: PR #22
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 |