mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-01 03:08:12 +01:00
fix(ci/cd): corrige formato inválido de etiquetas Docker
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"
This commit is contained in:
parent
9298f64546
commit
46ed60b86d
2 changed files with 14 additions and 1 deletions
2
.github/workflows/docker-intellidocs.yml
vendored
2
.github/workflows/docker-intellidocs.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
13
Dockerfile
13
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 \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue