Skip to content

Enable using docker build --platform switch (easily) #30369

@richlander

Description

@richlander

This is a specific aspect of: dotnet/dotnet-docker#4388

We constructed a "hero Dockerfile" that we want to offer users, but it doesn't work, sadly. There are multiple points of incompatibility that we need to resolve. See the other issue for more context.

For the SDK/CLI, it comes down to Docker's and .NET's syntax/symbols for architecture not matching.

Docker archs: 

  • amd64
  • arm64
  • arm

.NET RID archs:

  • x64
  • arm64
  • arm

The archs mostly match across the two systems, except for the first one. We need the RID in -r linux/am64 to be translated to linux/x64. No other change is needed (at least that we've discovered).

We only need this for Linux, for two reasons:

  • The ENVs we are using are only offered via Linux and buildkit. Windows doesn't use buildkit.
  • Cross-architecture docker isn't yet a scenario for Windows containers.

Metadata

Metadata

Assignees

Labels

Area-NetSDKUser StoryA single user-facing feature. Can be grouped under an epic.good first issueIssues that would be a good fit for someone new to the repository. Narrow in scope, well-defined.help wantedIssues that we would accept external contributions on. Also known as up-for-grabs.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions