Skip to content

Add dotnet new template for .dockerignore file #51129

@lbussell

Description

@lbussell

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    untriagedRequest triage from a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions