diff --git a/Makefile b/Makefile index a7eeaa00..5e4133e6 100644 --- a/Makefile +++ b/Makefile @@ -336,6 +336,7 @@ install-build-tools: define build_release $(eval GITREF ?= $(shell git describe --exact-match --tags HEAD 2>/dev/null || git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)) + @echo "GITREF=$(GITREF)" ./buildtools/build-release \ --target=$(1) \ $(if $(CLEANUP),--cleanup) \ @@ -364,6 +365,11 @@ release-static: release-tarball: $(call build_release,"tarball") +container: + $(eval GITREF ?= $(shell git describe --exact-match --tags HEAD 2>/dev/null || git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)) + @echo "GITREF=$(GITREF)" + ./buildtools/build-containerimage "$(GITREF)" + .PHONY: tags tags: rm -fv TAGS diff --git a/buildtools/build-containerimage b/buildtools/build-containerimage new file mode 100755 index 00000000..62047438 --- /dev/null +++ b/buildtools/build-containerimage @@ -0,0 +1,15 @@ +#!/bin/sh + +GIT_BRANCH="${1:-master}" + +podman \ + build \ + --squash \ + --no-cache \ + --force-rm \ + --build-arg="GIT_REPO=file:///mnt" \ + --build-arg="BRANCH=${GIT_BRANCH}" \ + -v "${PWD}":/mnt:ro \ + -f "buildtools/containerimage/Containerfile" \ + --tag "mergerfs:${GIT_BRANCH}" \ + buildtools/ diff --git a/buildtools/containerimage/Containerfile b/buildtools/containerimage/Containerfile new file mode 100644 index 00000000..7f4261e4 --- /dev/null +++ b/buildtools/containerimage/Containerfile @@ -0,0 +1,19 @@ +FROM --platform=linux/amd64 alpine:latest as build + +ARG GIT_REPO +ARG BRANCH + +RUN <