Skip to content

Multi-arch container publishing doesn't work when certain RID-forcing publish properties are set #49972

Open

Description

@baronfel

Describe the bug

See this Bluesky thread for context and discussion.

With multi-arch container publish being a thing, some users are using it with publish configurations that conflict with historical decisions that the .NET SDK has had. Specifically, while we would like the container publish for multi arch to logically look like

  • outer build does zero work
  • triggers N inner RID-specific build
  • outer build uses results of inner build to make image manifest

The decision to make the PublishContainer target implicitly rely on the Publish target (via the documented command dotnet publish -t:PublishContainer) means that the outer project (with no RID set) is also asked to publish - and as a result if the outer project has properties like PublishReadyToRun, PublishAot, etc set then the RuntimeIdentifierInference targets force it to get a RID, which then short-circuits the decision-making of the PublishContainer target on if it is doing multi-arch publish.

One workaround is to disable UseCurrentRuntimeIdentifier, but the CLi today seems to not allow passing false for this option.

Activity

  1. added
    Area-Containers
    multi-RID-publishing
    on Jul 28, 2025
  2. added theissue type on Jul 28, 2025
  3. added
    untriaged
    on Jul 28, 2025
  4. self-assigned this
    on Jul 28, 2025
  5. changed the title [-]Multi-arch container publishing doesn't work when certian RID-forcing publish properties are set[/-] [+]Multi-arch container publishing doesn't work when certain RID-forcing publish properties are set[/+] on Jul 28, 2025
  6. baronfel commented on Jul 28, 2025

    @baronfel
    MemberAuthor

    We were able to do something much nicer for the RID-specific tools feature because a) Pack is way less invasive, and b) we control the entire tool packaging process end-to-end. Neither of those are true for Publish, we'll need some serious thought here to make this work without breaking all of the current use cases that rely on implicitly getting a RID set.

  7. ChrisMcKee commented on Jul 28, 2025

    @ChrisMcKee

    We were able to do something much nicer for the RID-specific tools feature because a) Pack is way less invasive, and b) we control the entire tool packaging process end-to-end. Neither of those are true for Publish, we'll need some serious thought here to make this work without breaking all of the current use cases that rely on implicitly getting a RID set.

    Pack or build for containers would make more sense (imo) than publish.
    Publish, for web projects, was always more of a deployment thing, while containers are more of a build artifact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area-Containersmulti-RID-publishinguntriaged

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions