NMica 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package NMica --version 1.0.3
NuGet\Install-Package NMica -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NMica" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NMica --version 1.0.3
#r "nuget: NMica, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 dependencies
  • earlypackage - pre-release nuget dependencies
  • project - any project references that the app depends on
  • app - 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

There are no supported framework assets in this package.

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.

Version Downloads Last updated
2.4.7 5,618 4/4/2022
2.3.3 592 11/18/2021
2.1.4 14,421 11/27/2020
2.0.2 2,976 3/28/2020
1.3.4 679 2/27/2020
1.2.5 544 2/26/2020
1.1.5 498 2/25/2020
1.0.3 553 2/22/2020