summarylogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorWilliam Edwards2024-03-10 13:39:26 -0700
committerWilliam Edwards2024-03-10 13:39:26 -0700
commit8a23376f9f6fb0dbd94c64a5fbffb2359cf5ea09 (patch)
tree5ae81553ed8e0d466e985d885be5d5ee90dd5d01 /Makefile
parent95b218f9b6244c089a9252c2e96c86f0fffaaf8f (diff)
downloadaur-8a23376f9f6fb0dbd94c64a5fbffb2359cf5ea09.tar.gz
Add Dockerfile to build package in Docker
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7d2f3c0fee1b..3a1f7f788a45 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,23 @@
+IMAGE_NAME ?= makepkg.local
+IMAGE_TAG ?= latest
+UID = $(shell id -u)
+GID = $(shell id -g)
+
+.PHONY: build
build: clean
makepkg
makepkg --printsrcinfo > .SRCINFO
+.PHONY: clean
clean:
rm -rf *.tar.* *.pkg.* src pkg
+
+.PHONY: in-docker
+in-docker: clean
+ docker build -t $(IMAGE_NAME):$(IMAGE_TAG) .
+ docker run -it --rm \
+ --volume $(PWD):/src \
+ --workdir /src \
+ --user $(UID):$(GID) \
+ $(IMAGE_NAME):$(IMAGE_TAG) \
+ make build