content: FROM cmake-swig:debian_swig AS env
  
  # see: https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian
  RUN apt-get update -qq \
  && apt-get install -yq wget gpg apt-transport-https \
  && wget -q "https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb" -O packages-microsoft-prod.deb \
  && dpkg -i packages-microsoft-prod.deb \
  && rm packages-microsoft-prod.deb \
  && apt-get update -qq \
  && apt-get install -yq dotnet-sdk-8.0 \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  # Trigger first run experience by running arbitrary cmd
  RUN dotnet --info
  
  FROM env AS devel
  WORKDIR /home/project
  COPY . .
  
  FROM devel AS build
  RUN cmake -version
  RUN cmake -S. -Bbuild -DBUILD_DOTNET=ON
  RUN cmake --build build --target all -v
  RUN cmake --build build --target install -v
  
  FROM build AS test
  RUN CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test -v
  
  FROM env AS install_env
  WORKDIR /home/sample
  COPY --from=build /home/project/build/dotnet/packages/*.nupkg ./
  
  FROM install_env AS install_devel
  COPY ci/samples/dotnet .
  
  FROM install_devel AS install_build
  RUN dotnet build
  
  FROM install_build AS install_test
  RUN dotnet run
  