dockgen 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global dockgen --version 0.1.0
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local dockgen --version 0.1.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dockgen&version=0.1.0
nuke :add-package dockgen --version 0.1.0

dock-gen

dock-gen is a very simple .NET tool designed to generate Dockerfiles for one or multiple projects in a solution based on dependencies in a predictable way each time. It provides a simple and easy way to generate Dockerfiles for your .NET application.

Please note that since .NET 7, dotnet comes with a built-in feature to publish app as container image. If you don't need to generate Dockerfiles, you can use the dotnet publish command to publish your application as container. For more information, see the official documentation.

Installation

To install dock-gen, you can use the dotnet tool install command:

  1. global installation:
dotnet tool install --global dockgen
  1. local installation: (optional) if you don't have a manifest file for your project, create one:
dotnet new tool-manifest

Add the tool to the manifest file:

dotnet tool install dockgen

Usage

You can use dock-gen with the generate command. This command takes two optional parameters:

  • -s or --solution: To specify the solution file.
  • -p or --project: To specify the project file.

Here is an example of how to use the generate command:

dotnet dockgen generate -s MySolution.sln -p MyProject.csproj

If no solution or project file is specified, dock-gen will try to find a solution file in the current directory.

Features

  • Generate Dockerfile: Generate a Dockerfile for a single or multiple projects at once
  • Multi-Stage Build: Generate a multi-stage Dockerfile for a project
  • Central Package/Build Management: dock-gen supports CPM/CBM in your project

Contributing

We welcome contributions to dock-gen! Please see our contributing guide for more details.

License

dock-gen is open source software licensed under the MIT. See the LICENSE file for more details.

Contact

If you have any questions or feedback, please feel free to create an issue.

Acknowledgements

This project makes use of the following open source projects:

  • Buildalyzer: A utility for performing design-time builds of .NET projects to obtain information such as package references and compiler flags.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.2.1 97 5/12/2024
0.2.0 56 5/3/2024
0.1.0 92 4/30/2024