liveBook · Manning

Container

As explained in .NET in Action, Second Edition

A container is an isolated execution environment that packages an application with its dependencies while sharing the host operating system kernel.

A container provides an isolated, portable environment for running software. Its image specifies resources and dependencies, reducing differences between machines. Containers can also be built on top of other container images. section 13.0 section 13.1

A fixed runtime can prevent a dependency from changing unexpectedly. For example, a .NET Framework application expecting file paths to stop at 260 characters may break on a machine with .NET Framework 4.6.2, where the limit differs. A container based on a specific .NET image carries that version with it and can run on any machine with a matching OS. section 13.1

Container tooling varies by development and hosting context:

  • Docker provides a broad container-management ecosystem and is used for local development; .NET 7 and later also support creating containers directly. section 13.2
  • Production hosting options include Docker Swarm, Azure Container Instances, Amazon Elastic Container Service, and Kubernetes. section 13.2
  • ASP.NET Core can run in containers using Kestrel, supporting container-based microservices. section 1.2

How .NET in Action, Second Edition covers it

How deep it goes
Explains dependency isolation and runtime consistency, then surveys tools; it does not demonstrate building a container image.
Examples
Uses a .NET Framework file-path limit change and ASP.NET Core hosted by Kestrel as examples.
What you can do after
Evaluate/understand how containers isolate dependencies and preserve a selected .NET runtime across machines with a matching OS.
How it connects
Connects containers with container images, Docker, Kubernetes, ASP.NET Core, Kestrel, and microservices.

Also explained in

Compare how 27 books explain container →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.