Skip to content

Add dotnet new template for .dockerignore file #51129

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions