EdwinVW/dapr-traffic-control

Docker build fails after update to DotNet 8.

markarnott opened this issue · 1 comments

The TargetFramework in the csproj files is net8.0.

The Dockerfile uses dotnet/sdk:7.0-bullseye-slim

These two are incompatible.

Steps to reproduce the behavior:

  1. cd src/TrafficControlService
  2. docker build .

Expected behavior
A new image should be created.

Error Message

 => CACHED [build-env 3/6] COPY TrafficControlService.csproj ./                                                    0.0s
 => ERROR [build-env 4/6] RUN dotnet restore                                                                       1.3s
------
 > [build-env 4/6] RUN dotnet restore:
#0 1.187   Determining projects to restore...
#0 1.201 /usr/share/dotnet/sdk/7.0.406/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(160,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0.  Either target .NET 7.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. Download the .NET SDK from https://aka.ms/dotnet/download [/app/TrafficControlService.csproj]
------
Dockerfile:6
--------------------
   4 |     # Copy necessary files and restore as distinct layer
   5 |     COPY TrafficControlService.csproj ./
   6 | >>> RUN dotnet restore
   7 |
   8 |     # Copy everything else and build
--------------------
ERROR: failed to solve: process "/bin/sh -c dotnet restore" did not complete successfully: exit code: 1

**Environment **

  • Windows 11
  • Docker version 23.0.1-rd, build 393499b

Hi @markarnott.
Thanks for spotting this issue!
I have fixed it in #34.