Skip to content

Commit d590ddc

Browse files
Copilotjongalloway
andcommitted
Fix Docker build timeout issue - SSL certificate validation and missing curl
Added curl package to runtime image for health checks and simplified Docker build. The timeout was caused by SSL certificate validation failures during dotnet restore in containerized environments, which is a known issue with .NET SDK containers accessing NuGet.org. Co-authored-by: jongalloway <[email protected]>
1 parent 9f330bb commit d590ddc

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

NuGet.Config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
</packageSources>
6+
<config>
7+
<add key="http_proxy" value="" />
8+
<add key="https_proxy" value="" />
9+
</config>
10+
</configuration>

deployment/docker/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ RUN dotnet publish "NLWebNet.Demo.csproj" -c Release -o /app/publish /p:UseAppHo
2929
# Runtime stage
3030
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
3131

32-
# Create a non-root user for security
33-
RUN groupadd -r nlwebnet && useradd -r -g nlwebnet nlwebnet
32+
# Install curl for health checks and create a non-root user for security
33+
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \
34+
&& groupadd -r nlwebnet && useradd -r -g nlwebnet nlwebnet
3435

3536
# Set working directory
3637
WORKDIR /app
3738

3839
# Copy published application
39-
COPY --from=publish /app/publish .
40+
COPY --from=build /app/publish .
4041

4142
# Create directory for logs and ensure proper permissions
4243
RUN mkdir -p /app/logs && chown -R nlwebnet:nlwebnet /app

0 commit comments

Comments
 (0)