github.com/anchore/syft@v1.38.2/syft/pkg/cataloger/dotnet/test-fixtures/image-net8-app-single-file/Dockerfile (about)

     1  # This is the same as the net8-app image, however, the entire .NET runtime is compiled into a single binary, residing with the application.
     2  FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:8.0-alpine@sha256:7d3a75ca5c8ac4679908ef7a2591b9bc257c62bd530167de32bba105148bb7be AS build
     3  ARG RUNTIME=win-x64
     4  WORKDIR /src
     5  
     6  # copy csproj and restore as distinct layers
     7  COPY src/*.csproj .
     8  COPY src/packages.lock.json .
     9  RUN dotnet restore -r $RUNTIME --verbosity normal --locked-mode
    10  
    11  # copy and publish app and libraries (single file)
    12  COPY src/ .
    13  RUN dotnet publish -r $RUNTIME -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true --no-restore -o /app
    14  
    15  
    16  FROM busybox
    17  WORKDIR /app
    18  COPY --from=build /app .
    19  # just a nice to have for later...
    20  #COPY --from=build /src/packages.lock.json .