nuget fight
This commit is contained in:
+12
-2
@@ -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
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user