skip to content

When would you base an ASP.NET Core 10 image on a noble-chiseled .NET image, and what breaks if the app needs globalization but you skip the -extra variant?

level: seniorimportance: should knowfreq 30%

answer

  1. no shell, no package manager, non-root
  2. ContainerFamily=noble-chiseled
  3. DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
  4. -extra adds ICU and tzdata
  5. SDK picks chiseled for AOT and trimmed apps

basics

~20 s

Chiseled images hold only what .NET needs: no shell, no package manager, non-root by default, so they are smaller with less to patch. The plain variant lacks ICU and time-zone data and forces invariant globalization; apps needing them use -extra.

solid answer

~40 s

Ubuntu chiseled images (`aspnet:10.0-noble-chiseled`, `runtime-deps:10.0-noble-chiseled`) are .NET's distroless images: only the packages .NET needs, **no shell, no package manager, and `USER $APP_UID` already set**. You choose them for smaller images and a smaller attack surface, when nothing at run time needs a shell or extra OS packages. The plain chiseled image **omits ICU and tzdata** and sets `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true`, so culture-specific formatting falls back to invariant rules, creating a named culture fails, and time-zone lookups by id fail without zone data. The **`-extra`** variant adds ICU and tzdata. With the SDK, set `<ContainerFamily>noble-chiseled</ContainerFamily>`; the SDK appends `-extra` itself when the app does not set `InvariantGlobalization` to `true`, and for `PublishAot` or `PublishTrimmed` apps it already picks a `noble-chiseled` `runtime-deps` base.

code

xml · 6 lines
xml
<PropertyGroup>
  <TargetFramework>net10.0</TargetFramework>
  <!-- the SDK resolves aspnet:10.0-noble-chiseled-extra here,
       because InvariantGlobalization is not true -->
  <ContainerFamily>noble-chiseled</ContainerFamily>
</PropertyGroup>

go deeper

for a junior

Know that chiseled images are small, have no shell or package manager, and run as non-root.

for a middle

Explain the missing ICU and tzdata, the invariant mode it forces, and when the -extra variant is required.

for a senior

Choose between regular, chiseled and -extra per service, and adapt debugging, health checks and startup to a shell-less image.

for a principal

Decide whether chiseled becomes the default base across services, weighing CVE exposure against operational habits and debugging needs.

## What a chiseled image is **Ubuntu chiseled** images are built with Canonical's Chisel tool, which installs only **slices** of packages: the files .NET actually needs, without the rest of each package. The dotnet-docker documentation lists their features: - a minimal set of packages required to run a .NET app; - a **non-root user by default** (`USER $APP_UID`, uid 1654); - **no package manager**; - **no shell**. They exist for `runtime-deps`, `runtime` and `aspnet`, with tags such as `10.0-noble-chiseled`. There is no chiseled SDK image; you build on the regular SDK image and run on chiseled. ## Why choose them | Concern | Regular `aspnet:10.0` | `aspnet:10.0-noble-chiseled` | |---|---|---| | Size | Full Ubuntu base plus .NET | Much smaller | | Packages to patch and scan | Many | Only what .NET needs | | Default user | root (opt in with `USER $APP_UID`) | `app` (1654) | | Shell for `docker exec` | Yes | **No** | | Install OS packages at build | `apt-get` | Only via Chisel slices, and only on .NET 10+ images | For the quiz-game API, which only serves JSON, chiseled is a good fit: fewer CVEs to triage, non-root without a `USER` line, and nothing in the container for an attacker to run. ## What the plain chiseled image leaves out The `noble-chiseled` images do **not** include **ICU** (culture data) or **tzdata** (time-zone data), and they set `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true` because ICU is missing. In that mode: - formatting and parsing use invariant rules for every culture; - creating a culture such as `new CultureInfo("fr-FR")` throws `CultureNotFoundException`; - `TimeZoneInfo.FindSystemTimeZoneById("Europe/Paris")` fails because there are no zone files to read. The **`-extra`** variants (`10.0-noble-chiseled-extra`) add the ICU and tzdata slices. Pick them whenever the app formats by culture, uses request localization, or converts between named time zones; the quiz-game API showing scores in local time would need it. ## How the SDK chooses With `dotnet publish /t:PublishContainer`, the SDK's base-image logic in .NET 10 is: 1. If `ContainerBaseImage` is set, use it as given. 2. Else, if `ContainerFamily` is set (for example `noble-chiseled`), append it to the inferred tag, and append **`-extra`** too when the family ends in `-chiseled` and the project does not set `InvariantGlobalization` to `true`. 3. Else, for `PublishAot` or `PublishTrimmed` apps on glibc Linux, pick a `noble-chiseled` tag of `runtime-deps`, plus `-extra` unless `InvariantGlobalization` is `true`. 4. Else use the plain version tag, which is Ubuntu noble in .NET 10. So setting `InvariantGlobalization` in the project is the signal the SDK uses to choose between the plain and the `-extra` chiseled image. A hand-written Dockerfile gets no such help: choosing the tag is up to you. ## Native AOT and trimmed apps Chiseled images matter most for self-contained output. A Native AOT or trimmed app needs only the native dependencies, so the SDK bases it on `runtime-deps` with a `noble-chiseled` tag. The `webapiaot` template sets `InvariantGlobalization` to `true`, which keeps the plain chiseled image; set it to `false` and the SDK switches to the `-extra` variant so culture data is present. That pairing, a single native executable on a minimal non-root base, gives the smallest images .NET produces. ## Operating without a shell - `docker exec -it <container> sh` fails; there is no `sh`. Debug with logs, metrics and traces, or attach a separate debugging container that shares the process namespace. - Health checks cannot run `curl` inside the container; let the orchestrator probe the HTTP endpoint on 8080. - Startup scripts that use shell features need rewriting as application code or orchestrator configuration. ## When not to use chiseled Choose the regular image when the app needs OS packages that have no Chisel slice, when the team's operations depend on shelling into containers, or while a migration is under way and failures need quick inspection.

  • How do you debug a running container that has no shell?
    Rely on what the app emits: structured logs, metrics and traces, plus health endpoints probed from outside. For live inspection, attach a separate debugging container that shares the target's process namespace, so the tools live in that container rather than in the chiseled image. Avoid switching the production image to a regular base just to get a shell.
  • Can you add an OS package to a chiseled image?
    Only through Chisel slices, not `apt-get`, and the dotnet-docker documentation says installing additional packages needs the Chisel manifest that only .NET 10+ images include. If the package has no slice, use the regular image or ship the dependency another way.

  • Chiseled images include ICU, so culture formatting works the same as on the regular image.
  • You can docker exec into a chiseled container with sh to debug it.
  • Chiseled images still run as root unless the Dockerfile adds USER.
  • The SDK never chooses a chiseled base image unless ContainerBaseImage names one.
  • The -extra variant adds a shell and a package manager.