[Fix] Dockerfile.windows: aggiunge ContinuousIntegrationBuild=true a dotnet build e publish
Senza questo flag il target GenerateVersionJson nel .csproj veniva eseguito dentro il container Docker Windows dove: - Non esiste .git (fatal: not a git repository) - version.json copiato da COPY e' read-only o protetto → MSB3491: Access to the path '...\wwwroot\version.json' is denied Il Dockerfile Linux aveva gia /p:ContinuousIntegrationBuild=true. La condizione nel .csproj e': Condition="'' != 'true' AND '' != 'true'" quindi con il flag il target viene saltato e version.json usa quello generato dal workflow prima del docker build.
This commit was merged in pull request #13.
This commit is contained in:
+2
-2
@@ -25,13 +25,13 @@ COPY ["Components/", "Components/"]
|
||||
|
||||
# Build del progetto principale con output path corto
|
||||
WORKDIR "/s/Data_Coupler"
|
||||
RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --no-restore /p:MinVerVersionOverride=%APP_VERSION%
|
||||
RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --no-restore /p:ContinuousIntegrationBuild=true /p:MinVerVersionOverride=%APP_VERSION%
|
||||
|
||||
# Stage 2: Publish
|
||||
FROM build AS publish
|
||||
# Necessario ridichiarare ARG dopo FROM in multi-stage build
|
||||
ARG APP_VERSION=0.0.0-alpha.0
|
||||
RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore -r win-x64 --self-contained false /p:MinVerVersionOverride=%APP_VERSION%
|
||||
RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore -r win-x64 --self-contained false /p:ContinuousIntegrationBuild=true /p:MinVerVersionOverride=%APP_VERSION%
|
||||
|
||||
# Stage 3: Runtime
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0-nanoserver-ltsc2022 AS final
|
||||
|
||||
Reference in New Issue
Block a user