Fix Docker build: enable Windows targeting for cross-platform restore

Prowlarr.csproj multi-targets net8.0-windows which fails to restore on
Alpine Linux without EnableWindowsTargeting=true.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
nitrobass24 2026-04-06 21:30:25 -05:00
parent 183f3ec492
commit 20081b0687

View file

@ -27,7 +27,7 @@ COPY src/Prowlarr.Http/Prowlarr.Http.csproj src/Prowlarr.Http/
COPY src/ServiceHelpers/ServiceInstall/ServiceInstall.csproj src/ServiceHelpers/ServiceInstall/
COPY src/ServiceHelpers/ServiceUninstall/ServiceUninstall.csproj src/ServiceHelpers/ServiceUninstall/
RUN dotnet restore src/NzbDrone/Prowlarr.csproj -r "$(cat /tmp/rid)" -p:SelfContained=true
RUN dotnet restore src/NzbDrone/Prowlarr.csproj -r "$(cat /tmp/rid)" -p:SelfContained=true -p:EnableWindowsTargeting=true
# Copy remaining source and build
COPY src/ src/
@ -38,6 +38,7 @@ RUN dotnet publish src/NzbDrone/Prowlarr.csproj \
-r "$(cat /tmp/rid)" \
--self-contained \
--no-restore \
-p:EnableWindowsTargeting=true \
-o /build/bin && \
rm -rf /build/bin/Prowlarr.Update /build/bin/Prowlarr.Windows.* \
/build/bin/ServiceInstall.* /build/bin/ServiceUninstall.*