cloudfoundry / cloudfoundry/dotnet-core-buildpack

Dotnet buildpack always displays "dotnet first run" message in logs

Open
#1,014 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
97
Forks
91
Avg merge
1h
Merged PRs (30d)
2

Description

When running dotnet_core_buildpack it always displays "first launch" message from dotnet SDK, polluting logs. Ex:

-----> Dotnet-Core Buildpack version 2.4.30
-----> Supplying Dotnet Core
-----> Installing libunwind 1.8.1
       Copy [/tmp/buildpacks/a32ac21029fde3827cac2632ea8ee613/dependencies/d9bc4f683532d20ccd23d3fa985c236e/libunwind_1.8.1_linux_noarch_cflinuxfs4_98454ea1.tgz]
-----> Installing dotnet-sdk 8.0.302
       Copy [/tmp/buildpacks/a32ac21029fde3827cac2632ea8ee613/dependencies/d4d1cc391d667c0cf59176f907a02d71/dotnet-sdk_8.0.302_linux_x64_any-stack_6b6da5e6.tar.xz]
-----> Installing dotnet-runtime 8.0.6
       Copy [/tmp/buildpacks/a32ac21029fde3827cac2632ea8ee613/dependencies/fb4e215739afbab0e7fb65fa760ab938/dotnet-runtime_8.0.6_linux_x64_any-stack_5df0e17f.tar.xz]
-----> Finalizing Dotnet Core
-----> Installing dotnet-aspnetcore 8.0.6
       Copy [/tmp/buildpacks/a32ac21029fde3827cac2632ea8ee613/dependencies/eeba5dbe9ab53497039f54cf01fcd5b8/dotnet-aspnetcore_8.0.6_linux_x64_any-stack_8f4aa39c.tar.xz]
-----> Installing dotnet-runtime 8.0.6
       Copy [/tmp/buildpacks/a32ac21029fde3827cac2632ea8ee613/dependencies/fb4e215739afbab0e7fb65fa760ab938/dotnet-runtime_8.0.6_linux_x64_any-stack_5df0e17f.tar.xz]
-----> Publish dotnet
       
       Welcome to .NET 8.0!
       ---------------------
       SDK Version: 8.0.302
       
       Telemetry
       ---------
       The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
       
       Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
       
       ----------------
       Installed an ASP.NET Core HTTPS development certificate.
       To trust the certificate, view the instructions: https://aka.ms/dotnet-https-linux
       
       ----------------
       Write your first app: https://aka.ms/dotnet-hello-world
       Find out what's new: https://aka.ms/dotnet-whats-new
       Explore documentation: https://aka.ms/dotnet-docs
       Report issues and find source on GitHub: https://github.com/dotnet/core
       Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
       --------------------------------------------------------------------------------------
         Determining projects to restore...
         Restored /home/vcap/app/SampleApp.csproj (in 12.12 sec).
         SampleApp -> /home/vcap/app/bin/Debug/net8.0/linux-x64/SampleApp.dll
         SampleApp -> /tmp/contents2140895411/deps/1/dotnet_publish/
-----> Cleaning staging area
       Removing .nuget
       Removing .local
       Removing dotnet-sdk

This should be disabled by setting environmental variables as follows:

DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the dotnet_core_buildpack flow around the “Publish dotnet” step and locate where the dotnet SDK command environment is configured. Set DOTNET_NOLOGO and DOTNET_CLI_TELEMETRY_OPTOUT as requested, then run a build using the shown workflow and confirm the first-run message no longer appears in the logs.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.