content: FROM ortools/cmake:rockylinux_swig AS env
  
  # Install .NET SDK
  # see: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
  RUN wget -q "https://dot.net/v1/dotnet-install.sh" \
  && chmod a+x dotnet-install.sh \
  && ./dotnet-install.sh -c 8.0 -i /usr/local/bin
  # Trigger first run experience by running arbitrary cmd
  RUN dotnet --info
  
  # Add the library src to our build env
  FROM env AS devel
  WORKDIR /home/project
  COPY . .
  RUN sed -i 's/\(<SignAssembly>\).*\(<\/SignAssembly>\)/\1false\2/' ortools/dotnet/Google.OrTools*.csproj.in
  
  FROM devel AS build
  RUN cmake -version
  RUN cmake -S. -Bbuild -DBUILD_DOTNET=ON -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
  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 cmake/samples/dotnet .
  
  FROM install_devel AS install_build
  RUN dotnet build
  
  FROM install_build AS install_test
  RUN dotnet test
  