nuget fight2
This commit is contained in:
+9
-7
@@ -12,23 +12,25 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
|
||||
# --- NEW: ensure CA certs + curl are present and up to date in the SDK image ---
|
||||
# Ensure CA certs + curl present
|
||||
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 ---
|
||||
# --- NEW: force .NET's HTTP handler off HTTP/2/3 (use HTTP/1.1 over TLS 1.2) ---
|
||||
ENV DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP2SUPPORTENABLED=false \
|
||||
DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP3SUPPORTENABLED=false
|
||||
|
||||
# Bring in nuget.config first (cached 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
|
||||
# --- DEBUG: test HTTPS *using HTTP/1.1 + TLS 1.2* from inside this image ---
|
||||
RUN curl --http1.1 --tls-max 1.2 -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.
|
||||
# Restore with our nuget.config, still diagnostic while we stabilize
|
||||
RUN dotnet restore "SystemRevivalServer.csproj" \
|
||||
--disable-parallel \
|
||||
--verbosity diagnostic
|
||||
|
||||
Reference in New Issue
Block a user