nuget fight

This commit is contained in:
dingo
2025-12-04 07:51:51 -05:00
parent 9ba0a25050
commit 016f7c6398
2 changed files with 19 additions and 11 deletions
+12 -2
View File
@@ -12,16 +12,26 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
# --- NEW: bring in nuget.config first so it gets its own cached layer ---
# --- NEW: ensure CA certs + curl are present and up to date in the SDK image ---
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
# --- NEW: bring in nuget.config FIRST so it's cached as its own layer ---
COPY nuget.config ./
# Copy the project file
COPY SystemRevivalServer.csproj ./
# --- DEBUG STEP: test HTTPS to NuGet from *inside this image* using curl ---
# If this fails, you'll see the TLS / network error plainly in the build log.
RUN curl -vI https://api.nuget.org/v3/index.json
# --- UPDATED: more robust restore using our nuget.config ---
# Temporarily using 'diagnostic' so we can see the real inner error for NU1301.
RUN dotnet restore "SystemRevivalServer.csproj" \
--disable-parallel \
--verbosity minimal
--verbosity diagnostic
# Copy the rest of the source
COPY . .
+7 -9
View File
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<config>
<!-- Longer timeout so NuGet has some breathing room -->
<add key="defaultTimeout" value="600" />
<!-- Stable cache location for better layer reuse -->
<add key="globalPackagesFolder" value="/root/.nuget/packages" />
</config>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<config>
<add key="defaultTimeout" value="600" />
<add key="globalPackagesFolder" value="/root/.nuget/packages" />
</config>
</configuration>