liveBook · Manning

Container

As explained in Building Distributed Applications that Work

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

A container is a lightweight, isolated environment for running an application with its dependencies, including libraries, binaries, and configuration. Packaging these together helps the application run consistently on a developer’s machine, in testing, and in production. section 2.1

Docker containers share the host operating system kernel rather than installing a full operating system for each instance. Linux namespaces and cgroups provide isolation, so containers do not interfere with one another or the host. Compared with virtual machines, this approach reduces resource use and startup time. section 2.1

To use containers as application infrastructure:

  • Start with a Docker image: a template containing the application code and what it needs to run. section 2.1
  • Add the container to an Aspire app host using its native methods; use extension methods for additional configuration. section 2.8
  • Pass URLs resolved from Aspire-hosted apps into containers as environment variables, or connect Aspire to an externally hosted container. section 2.8

Infrastructure for an online shop

A Keycloak Docker container can provide identity infrastructure for single sign-on. Redis is another infrastructure component, but it can be added through a prebuilt Aspire integration instead of configuring a raw container. Integrations wrap containers or managed-resource references and simplify setup. section 2.0 section 2.8

Figure 2.1 Docker container structure
figure

Use the container-structure figure to visualize the packaged application and dependencies described here. section 2.1

How Building Distributed Applications that Work covers it

How deep it goes
Defines packaging, isolation, kernel sharing, and Docker images at overview level; defers detailed Docker coverage.
Examples
Uses a Keycloak Docker container for single sign-on and a prebuilt Redis integration as contrasting infrastructure examples.
What it assumes
Introduces Docker fundamentals before Aspire infrastructure setup; points elsewhere for detailed Docker coverage.
What you can do after
Operate/configure it through Aspire app-host methods, extension methods, environment variables, or an external-container connection.
How it connects
Connects containers to Docker images, Aspire integrations, service discovery, and single sign-on.

Also explained in

Compare how 27 books explain container →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Distributed Applications that Work. The section links point to the parts of the book it draws on.