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

     1  # This is the same as the net8-app image, however, the .NET runtime is copied to the target directory tree. There
     2  # is no bundling to include the runtime within a single archive/binary.
     3  FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:8.0-alpine@sha256:7d3a75ca5c8ac4679908ef7a2591b9bc257c62bd530167de32bba105148bb7be AS build
     4  ARG RUNTIME=win-x64
     5  WORKDIR /src
     6  
     7  # copy csproj and restore as distinct layers
     8  COPY src/*.csproj .
     9  COPY src/packages.lock.json .
    10  RUN dotnet restore -r $RUNTIME --verbosity normal --locked-mode
    11  
    12  # copy and publish app and libraries (self-contained!)
    13  COPY src/ .
    14  RUN dotnet publish -r $RUNTIME --self-contained --no-restore -o /app
    15  
    16  
    17  FROM busybox
    18  WORKDIR /app
    19  COPY --from=build /app .
    20  # just a nice to have for later...
    21  #COPY --from=build /src/packages.lock.json .