Default container image name and tag changed

In .NET Aspire 9.1, the default container image name and tag assigned to the container resource when using AddDockerfile or WithDockerfile changed. This change affects how container images are named and tagged by default, improving consistency and safety.

Version introduced

.NET Aspire 9.1

Previous behavior

In .NET Aspire 9.0:

  • The default container image name used was based on this format: {ResourceName}-image-{HashOfAppHostDirectory}
  • The default container tag used was simply latest

New behavior

In .NET Aspire 9.1:

  • The default container image name used is now simply the resource name lowercased.
  • The default container tag used is now a hash derived from the app host directory combined with a timestamp of when the method was called.

Type of breaking change

This change is a behavioral change.

Reason for change

The previous behavior led to a bug. The resource name wasn't properly sanitized, resulting in unsafe, and unfriendly container image names. Additionally, tagging all images as latest made it difficult to manage and roll back deployments.

Users should update any deployment tools, scripts, and processes to accommodate the new image names and tags.

Note

The default image name and tag can be overridden by calling WithImage and WithImageTag on the IResourceBuilder<ContainerResource> respectively.

Affected APIs