From 6b05d8d9e548d5c3639c70fa29017e8e0a30874c Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Sat, 19 Sep 2026 01:39:42 +0200 Subject: [PATCH] Publish a slim Docker image without LibreOffice/aria2/media tooling The full image bundles LibreOffice, CJK fonts, ffmpeg, vips, libraw, aria2, and supervisord for thumbnail/download features many deployments never use. Adds Dockerfile.slim shipping just the binary on alpine with tzdata, and goreleaser entries publishing :slim and :-slim manifests alongside the existing images. No supervisor: the container entrypoint is the cloudreve binary directly. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .goreleaser.yaml | 27 +++++++++++++++++++++++++++ Dockerfile.slim | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Dockerfile.slim diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 193c51a1..833f2ad1 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -102,6 +102,25 @@ dockers: - .build/entrypoint.sh image_templates: - "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-arm64" + - dockerfile: Dockerfile.slim + use: buildx + build_flag_templates: + - "--platform=linux/amd64" + - "--provenance=false" + goos: linux + goarch: amd64 + goamd64: v1 + image_templates: + - "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-slim-amd64" + - dockerfile: Dockerfile.slim + use: buildx + build_flag_templates: + - "--platform=linux/arm64" + - "--provenance=false" + goos: linux + goarch: arm64 + image_templates: + - "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-slim-arm64" docker_manifests: - name_template: "ghcr.io/dvorinka/cloudreve:latest" @@ -116,3 +135,11 @@ docker_manifests: image_templates: - "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-amd64" - "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-arm64" + - name_template: "ghcr.io/dvorinka/cloudreve:slim" + image_templates: + - "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-slim-amd64" + - "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-slim-arm64" + - name_template: "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-slim" + image_templates: + - "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-slim-amd64" + - "ghcr.io/dvorinka/cloudreve:{{ .Tag }}-slim-arm64" diff --git a/Dockerfile.slim b/Dockerfile.slim new file mode 100644 index 00000000..bb41271a --- /dev/null +++ b/Dockerfile.slim @@ -0,0 +1,35 @@ +# Slim variant: no LibreOffice, fonts, aria2, or media/thumbnail tooling. +# Build stage + +FROM ghcr.io/goreleaser/goreleaser:v2.10.2 AS builder + +WORKDIR /src + +# Install goreleaser +RUN apk add --no-cache bash curl git npm nodejs tar zip +RUN npm install -g yarn + +# Perform the build +COPY . . + +RUN goreleaser build --single-target --snapshot + +# Runtime stage +FROM alpine:latest + +WORKDIR /cloudreve + +RUN apk update \ + && apk add --no-cache tzdata \ + && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ + && echo "Asia/Shanghai" > /etc/timezone + +COPY --from=builder /src/dist/*/cloudreve ./cloudreve + +RUN chmod +x ./cloudreve + +EXPOSE 5212 + +VOLUME ["/cloudreve/data"] + +ENTRYPOINT ["./cloudreve"]