aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2024-12-11 10:04:48 +0800
committerAaron LI <aly@aaronly.me>2024-12-11 10:04:48 +0800
commit23b997e8bc40fc501c7a25ea820d02d417f9027c (patch)
tree5493b3837f59d68235ef42c17a6f00262d8dad66
parenta8f18c540879a681ea56e8cdc88419c09fc6e68a (diff)
downloadresume-23b997e8bc40fc501c7a25ea820d02d417f9027c.tar.bz2
Use an empty context for docker/podman image building
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4e879c0..a4cb182 100644
--- a/Makefile
+++ b/Makefile
@@ -39,13 +39,19 @@ cleanall:
.PHONY: all en zh dist clean cleanall
DOCKER_CLI?= sudo docker
-DOCKER_IMAGE:= resume:builder
+DOCKER_IMAGE:= resume:test
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 .
+ { \
+ rm -rf _empty && \
+ mkdir _empty && \
+ $(DOCKER_CLI) build --tag $(DOCKER_IMAGE) \
+ -f Dockerfile _empty && \
+ rmdir _empty; \
+ }
$(DOCKER_CLI) run --rm --volume $(PWD):/build $(DOCKER_IMAGE) \
sh -c "cd /build && make clean && make && $(DOCKER_CHOWN)"