diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8c935f..3c1fe46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ jobs: filters: | mergerfs: 'mergerfs/**' snapraid: 'snapraid/**' + snapraid-daemon: 'snapraid-daemon/**' validate: runs-on: ubuntu-latest diff --git a/snapraid-daemon/.env b/snapraid-daemon/.env new file mode 100644 index 0000000..a4245aa --- /dev/null +++ b/snapraid-daemon/.env @@ -0,0 +1,2 @@ +# renovate: datasource=github-releases depName=amadvance/snapraid-daemon +VERSION=1.0 diff --git a/snapraid-daemon/Dockerfile b/snapraid-daemon/Dockerfile new file mode 100644 index 0000000..4f193e4 --- /dev/null +++ b/snapraid-daemon/Dockerfile @@ -0,0 +1,34 @@ +# syntax=docker/dockerfile:1 +# hadolint global ignore=DL3007,DL3018 +FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.9.0 AS xx + +# ========================================================= +FROM --platform=$BUILDPLATFORM alpine:3.23.3 AS build +SHELL ["/bin/ash", "-euxo", "pipefail", "-c"] +RUN apk add --no-cache clang make +COPY --from=xx / / +WORKDIR /src +ARG VERSION +RUN \ + url="https://github.com/amadvance/snapraid-daemon/releases/download/v${VERSION}/snapraid-daemon-${VERSION}.tar.gz"; \ + wget -qO- "$url" | tar xz --strip-components=1 +ARG TARGETPLATFORM +RUN \ + xx-apk add xx-c-essentials; \ + CC=xx-clang LDFLAGS=-static ./configure --host "$(xx-clang --print-target-triple)"; \ + make; \ + xx-verify --static snapraidd; \ + ./snapraidd --version + +# ========================================================= +FROM scratch AS image +COPY --from=build /src/snapraidd /usr/bin/ +ARG VERSION +LABEL org.opencontainers.image.title="snapraid-daemon" +LABEL org.opencontainers.image.description="snapraid-daemon is a backup program for disk arrays. It stores parity information of your data and it recovers from up to six disk failures." +LABEL org.opencontainers.image.url="https://www.snapraid.it" +LABEL org.opencontainers.image.version="${VERSION}" +LABEL org.opencontainers.image.licenses="GPL-3.0" +LABEL org.opencontainers.image.source="https://github.com/sprat/docker-images" +LABEL org.opencontainers.image.authors="Sylvain Prat " +ENTRYPOINT ["/usr/bin/snapraidd"] diff --git a/snapraid-daemon/README.md b/snapraid-daemon/README.md new file mode 100644 index 0000000..6fafa20 --- /dev/null +++ b/snapraid-daemon/README.md @@ -0,0 +1,24 @@ +# snapraid-daemon + +This is an unofficial Docker image of [snapraid daemon](https://www.snapraid.it/), a backup program for disk arrays. + +snapraid daemon is made by Andrea Mazzoleni and licensed under GPL-3.0. See the snapraid daemon site for more details. + +This image contains a single static binary of snapraidd, nothing more. + +To use this image: +- mount your configuration file in `/etc/snapraidd.conf` +- mount the disk devices and mountpoints into the container + +Here is a example `compose.yaml` file: +```yaml +services: + snapraid-daemon: + image: sprat/snapraid-daemon:latest + ports: + - 7627:7627 + volumes: + - ./snapraidd.conf:/etc/snapraidd.conf:ro # the snapraid daemon configuration + - /dev:/dev # the disk devices are here + - /media:/media # the mountpoints are inside this directory +``` diff --git a/snapraid-daemon/compose.yml b/snapraid-daemon/compose.yml new file mode 100644 index 0000000..44eb9cf --- /dev/null +++ b/snapraid-daemon/compose.yml @@ -0,0 +1,25 @@ +services: + ui: + image: sprat/snapraid-daemon:latest + ports: + - 7627:7627 + build: + args: + VERSION: ${VERSION} + tags: + - sprat/snapraid-daemon:${VERSION} + - sprat/snapraid-daemon:latest + x-bake: + platforms: + - linux/amd64 + - linux/arm64 + - linux/arm/v7 + + test: + image: busybox:latest + command: + - wget + - -q + - http://ui:7627/ + depends_on: + - ui