[Breaking change]: AddDockerfile/WithDockerfile default container image name and tag changed in Aspire 9.1 #2557
Labels
⛓️💥 breaking-change
Issues or PRs tracking breaking changes.
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
in-pr
okr-freshness
OKR: Freshness of content
Pri1
High priority, do before Pri2 and Pri3
🗺️ reQUEST
Triggers an issue to be imported into Quest.
Description
In Aspire 9.1, the default container image name and tag assigned to the container resource when using
AddDockerfile
orWithDockerfile
are changing.Version
Other (please put exact version in description textbox)
Previous behavior
In Aspire 9.0:
{ResourceName}-image-{HashOfAppHostDirectory}
latest
New behavior
In Aspire 9.1:
Type of breaking change
Reason for change
The previous behavior caused the bug dotnet/aspire#7462 as the resource name wasn't properly sanitized to be a safe container image name, didn't result in very friendly container names when using Dockerfiles, and resulted in images simply tagged as "latest" on every build/publish, potentially making it difficult to roll-back deployments.
Recommended action
Users should be aware that the generated image names and tags are now different to what they'd previously been and update any dependent deployment tools, scripts, and processes accordingly.
Note that the default image name and tag can be overridden by calling
WithImage
andWithImageTag
on theIResourceBuilder<ContainerResource>
respectivelyAffected APIs
Aspire.Hosting.ContainerResourceBuilderExtensions
AddDockerfile(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, string? dockerfilePath = null, string? stage = null)
WithDockerfile<T>(this IResourceBuilder<T> builder, string contextPath, string? dockerfilePath = null, string? stage = null) where T : ContainerResource
The text was updated successfully, but these errors were encountered: