Is your feature request related to a problem? Please describe.
When buliding a .NET Dockerfile, there are some directories that you should not copy into the Dockerfile's build context.
Currently, the best thing to do is visit the dotnet-docker samples and copy a known-good .dockerignore file from there.
Describe the solution you'd like
.NET should have a .dockerignore template built in. You should be able to run dotnet new dockerignore just like you run dotnet new gitignore in a new solution.
While this wouldn't make a difference for the SDK container publish feature, it would improve the UX when using Dockerfiles directly.
Additional context
Related: #16784 (comment)
Is your feature request related to a problem? Please describe.
When buliding a .NET Dockerfile, there are some directories that you should not copy into the Dockerfile's build context.
Currently, the best thing to do is visit the dotnet-docker samples and copy a known-good
.dockerignorefile from there.Describe the solution you'd like
.NET should have a
.dockerignoretemplate built in. You should be able to rundotnet new dockerignorejust like you rundotnet new gitignorein a new solution.While this wouldn't make a difference for the SDK container publish feature, it would improve the UX when using Dockerfiles directly.
Additional context
Related: #16784 (comment)