From 46ed60b86dfd8999320c8f050f695b495f650abc Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 17 Nov 2025 16:16:39 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci/cd):=20corrige=20formato=20inv=C3=A1lido?= =?UTF-8?q?=20de=20etiquetas=20Docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Soluciona el error "invalid reference format" que ocurría cuando se generaban tags Docker con formato inválido como ":-bcbb6d2". Cambios en workflow: - Elimina prefix={{branch}}- del tag type=sha que causaba el formato inválido cuando branch estaba vacío - Simplifica a type=sha,format=short para generar tags como sha-bcbb6d2 Cambios en Dockerfile: - Añade declaraciones ARG con valores por defecto para BUILD_DATE, VERSION y REVISION (dev, unknown) - Añade labels OCI estándar para metadatos de imagen - Garantiza que las variables siempre tengan valores válidos Esto previene errores como: ERROR: failed to build: invalid tag "ghcr.io/dawnsystem/intellidocs-ngx:-bcbb6d2" --- .github/workflows/docker-intellidocs.yml | 2 +- Dockerfile | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-intellidocs.yml b/.github/workflows/docker-intellidocs.yml index 53c726e6a..174389e77 100644 --- a/.github/workflows/docker-intellidocs.yml +++ b/.github/workflows/docker-intellidocs.yml @@ -132,7 +132,7 @@ jobs: type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - type=sha,prefix={{branch}}-,format=short + type=sha,format=short type=raw,value=latest,enable={{is_default_branch}} - name: Build and push Docker image diff --git a/Dockerfile b/Dockerfile index 9ecdd2fa1..aa54da175 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,6 +95,14 @@ LABEL org.opencontainers.image.source="https://github.com/paperless-ngx/paperles LABEL org.opencontainers.image.url="https://github.com/paperless-ngx/paperless-ngx" LABEL org.opencontainers.image.licenses="GPL-3.0-only" +# Build metadata labels +ARG BUILD_DATE +ARG VERSION +ARG REVISION +LABEL org.opencontainers.image.created="${BUILD_DATE}" +LABEL org.opencontainers.image.version="${VERSION}" +LABEL org.opencontainers.image.revision="${REVISION}" + ARG DEBIAN_FRONTEND=noninteractive # Buildx provided, must be defined to use though @@ -105,6 +113,11 @@ ARG JBIG2ENC_VERSION=0.30 ARG QPDF_VERSION=11.9.0 ARG GS_VERSION=10.03.1 +# Image metadata variables with defaults +ARG BUILD_DATE=unknown +ARG VERSION=dev +ARG REVISION=unknown + # Set Python environment variables ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \