dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.73k stars 1.07k forks source link

Make first run an explicit operation #16880

Open richlander opened 3 years ago

richlander commented 3 years ago

For .NET SDK containers, it is critical that we control the first run experience. There are design truths of containers that need to be appreciated:

As a result, running actual first run logic is antithetical to containers. We've always run dotnet help as a sort of hack to manage first run. That is unintuitive. We know that lots of people clone our Dockerfiles. Big companies, other OSS projects, and other clouds tell us that they do this. They've also expressed their appreciation for the careful design and thoughtfulness we put into the Dockerfiles so that they can easily consume them. This issue is the biggest remaining challenge we have.

We recently made changes to our Dockerfiles to make our first run handling more explicit/intentional. Unfortunately, this is making our Dockerfiles more verbose.

And, we're still relying on dotnet help.

We'd like a new command -- call it dotnet init -- that takes a set of argument that enable us to describe our intent.

dotnet init --no-logo --generate-aspnet-certificate=0 --nuget-xml-doc-mode=skip

Half of the ENVs we set are used only at startup. That's unfortunate. With the proposed model, we'd get the following benefits:

dotnet-issue-labeler[bot] commented 3 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

KathleenDollard commented 3 years ago

I'd like an explicit switch for skipping the telemetry message. Otherwise this seems like a good idea.

richlander commented 3 years ago

NOLOGO is that, and we already had a conversation about that exact topic. NOLOGO needs to be the "no extra console output" control. If you want to create a new one that does less than that, that works.

KathleenDollard commented 3 years ago

That sounds good. Let's stick with that for now so it is consistent within containers and for non-containers.