From f8270d7f9046ba9522f1043b3403fcd6a137202e Mon Sep 17 00:00:00 2001 From: Trevor Swanson <83826109+trevorswanson@users.noreply.github.com> Date: Wed, 26 Nov 2025 19:47:52 -0500 Subject: [PATCH] ci: Add OCI Image Specification Labels to Dockerfile (#1636) * ci: Add OCI labels to Dockerfile Added OCI labels for metadata and documentation. * ci: Add APP_VERSION and APP_REVISION arguments Added ARG directives for application version and revision to Dockerfile. * ci: Add APP_REVISION build argument to Docker build --- .github/workflows/docker-build-publish.yml | 1 + Dockerfile | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.yml index e804fd5be..b046d6b99 100644 --- a/.github/workflows/docker-build-publish.yml +++ b/.github/workflows/docker-build-publish.yml @@ -167,6 +167,7 @@ jobs: docker buildx build \ --platform linux/amd64,linux/arm64 \ --build-arg APP_VERSION=${{ env.image_tag }} \ + --build-arg APP_REVISION=${{ github.sha }} \ --tag booklore/booklore:${{ env.image_tag }} \ --tag ghcr.io/booklore-app/booklore:${{ env.image_tag }} \ --push . diff --git a/Dockerfile b/Dockerfile index 43b66e65f..6977ee8c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,20 @@ RUN gradle clean build -x test # Stage 3: Final image FROM eclipse-temurin:25-jre-alpine +ARG APP_VERSION +ARG APP_REVISION + +# Set OCI labels +LABEL org.opencontainers.image.title="BookLore" \ + org.opencontainers.image.description="BookLore: A self-hosted, multi-user digital library with smart shelves, auto metadata, Kobo & KOReader sync, BookDrop imports, OPDS support, and a built-in reader for EPUB, PDF, and comics." \ + org.opencontainers.image.source="https://github.com/booklore-app/booklore" \ + org.opencontainers.image.url="https://github.com/booklore-app/booklore" \ + org.opencontainers.image.documentation="https://booklore-app.github.io/booklore-docs/docs/getting-started" \ + org.opencontainers.image.version=$APP_VERSION \ + org.opencontainers.image.revision=$APP_REVISION \ + org.opencontainers.image.licenses="GPL-3.0" \ + org.opencontainers.image.base.name="docker.io/library/eclipse-temurin:25-jre-alpine" + RUN apk update && apk add nginx gettext su-exec COPY ./nginx.conf /etc/nginx/nginx.conf @@ -41,4 +55,4 @@ RUN chmod +x /start.sh EXPOSE 8080 80 -CMD ["/start.sh"] \ No newline at end of file +CMD ["/start.sh"]