trapexit
3 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
40 additions and
0 deletions
-
Makefile
-
buildtools/build-containerimage
-
buildtools/containerimage/Containerfile
|
|
@ -336,6 +336,7 @@ install-build-tools: |
|
|
|
|
|
|
|
|
define build_release |
|
|
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)) |
|
|
$(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 \
|
|
|
./buildtools/build-release \
|
|
|
--target=$(1) \
|
|
|
--target=$(1) \
|
|
|
$(if $(CLEANUP),--cleanup) \
|
|
|
$(if $(CLEANUP),--cleanup) \
|
|
|
@ -364,6 +365,11 @@ release-static: |
|
|
release-tarball: |
|
|
release-tarball: |
|
|
$(call build_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 |
|
|
.PHONY: tags |
|
|
tags: |
|
|
tags: |
|
|
rm -fv TAGS |
|
|
rm -fv TAGS |
|
|
|
|
|
@ -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/ |
|
|
@ -0,0 +1,19 @@ |
|
|
|
|
|
FROM --platform=linux/amd64 alpine:latest as build |
|
|
|
|
|
|
|
|
|
|
|
ARG GIT_REPO |
|
|
|
|
|
ARG BRANCH |
|
|
|
|
|
|
|
|
|
|
|
RUN <<EOF |
|
|
|
|
|
apk add git gcc g++ make linux-headers |
|
|
|
|
|
git clone --single-branch --branch="${BRANCH}" "${GIT_REPO}" /tmp/mergerfs |
|
|
|
|
|
cd /tmp/mergerfs |
|
|
|
|
|
make NDEBUG=1 LTO=1 STATIC=1 DESTDIR=/tmp/install -j$(nproc) install |
|
|
|
|
|
tar cvfz /tmp/mergerfs.tgz --directory=/tmp/install usr sbin |
|
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
|
|
|
FROM --platform=linux/amd64 alpine:latest |
|
|
|
|
|
RUN --mount=from=build,source=/tmp/mergerfs.tgz,target=/tmp/mergerfs.tgz <<EOF |
|
|
|
|
|
tar xvf /tmp/mergerfs.tgz -C / |
|
|
|
|
|
EOF |
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/mergerfs"] |
|
|
|
|
|
CMD ["--help"] |