Fix: Ottimizzato Dockerfile e risolto timeout push registry Gitea
- Migrato immagine runtime da Debian a Alpine (riduzione ~60% dimensione) - Aggiunto suffisso -linux ai tag per manifest multi-platform - Disabilitate attestations/provenance per ridurre overhead push - Implementato retry automatico in caso di fallimento push - Corretto utilizzo apk invece di apt-get per Alpine Linux Risolve: HTTP 524 timeout durante push immagini al registry
This commit was merged in pull request #7.
This commit is contained in:
@@ -92,6 +92,20 @@ jobs:
|
|||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
|
# Aumenta timeout per registry lenti
|
||||||
|
build-args: |
|
||||||
|
BUILDKIT_STEP_LOG_MAX_SIZE=50000000
|
||||||
|
provenance: false
|
||||||
|
sbom: false
|
||||||
|
env:
|
||||||
|
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
|
||||||
|
|
||||||
|
- name: Retry push on failure
|
||||||
|
if: failure() && steps.build.outcome == 'failure'
|
||||||
|
run: |
|
||||||
|
echo "Retry push after 30 seconds..."
|
||||||
|
sleep 30
|
||||||
|
docker push $(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
name: Build Windows Container
|
name: Build Windows Container
|
||||||
|
|||||||
+8
-5
@@ -24,17 +24,20 @@ RUN dotnet build "Data_Coupler.csproj" -c Release -o /app/build
|
|||||||
|
|
||||||
# Stage 2: Publish
|
# Stage 2: Publish
|
||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
RUN dotnet publish "Data_Coupler.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
RUN dotnet publish "Data_Coupler.csproj" -c Release -o /app/publish \
|
||||||
|
/p:UseAppHost=false \
|
||||||
|
/p:PublishTrimmed=false \
|
||||||
|
/p:PublishSingleFile=false
|
||||||
|
|
||||||
# Stage 3: Runtime
|
# Stage 3: Runtime
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Installa le dipendenze necessarie per ExcelDataReader e altre librerie
|
# Installa le dipendenze necessarie per ExcelDataReader e altre librerie
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apk add --no-cache \
|
||||||
libgdiplus \
|
libgdiplus \
|
||||||
libc6-dev \
|
icu-libs \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
# Crea la directory per il database con i permessi corretti
|
# Crea la directory per il database con i permessi corretti
|
||||||
RUN mkdir -p /var/lib/Data_Coupler && \
|
RUN mkdir -p /var/lib/Data_Coupler && \
|
||||||
|
|||||||
Reference in New Issue
Block a user