NMica 1.0.3
See the version list below for details.
dotnet add package NMica --version 1.0.3
NuGet\Install-Package NMica -Version 1.0.3
<PackageReference Include="NMica" Version="1.0.3" />
paket add NMica --version 1.0.3
#r "nuget: NMica, 1.0.3"
// Install NMica as a Cake Addin #addin nuget:?package=NMica&version=1.0.3 // Install NMica as a Cake Tool #tool nuget:?package=NMica&version=1.0.3
Only projects targeting .NET Core v2.1 or v3.1 are supported (these are frameworks that have not reached the end of life, 3.0 will be EOL Mar 3, 2020)
Features
- Autogenerate Dockerfile for every compatible project in solution
- Select appropriate build & run docker image based on
TargetFramework
version and SDK - Support for nuget.config with local source packages
- Multistage container build
- Intelligent layering for .NET projects (see below)
Intelligent Dockerfile generation
NMica significantly improves on the default recommended Dockerfile template used for .NET applications by creating final run image in layers that significantly improves caching and minimizes image size. The default Dockerfile copies the entire output of dotnet publish
as a single layer into the final run image. Many items in that output folder will stay static between builds, such as nuget dependency DLLs, but since they are copied as a single operation this creates a single distinct layer in that image. Usually your application code will change much more frequently then the dependencies, so building up your app in layers allow much higher reuse of docker layer caching. NMica instead creates the following layers ordered based on likelihood of change between builds, from least common to most common:
package
- stable nuget dependenciesearlypackage
- pre-release nuget dependenciesproject
- any project references that the app depends onapp
- the target project itself (and any files that don't fall in the above categories)
On a project with many NuGet dependencies, this can reduce the size of the new layers that are generated for new image associated with image from double digit megabytes to a few KB due to cache hits
See this blog post for more details
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.