-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support publishing of multi-architecture OCI container images #43085
Support publishing of multi-architecture OCI container images #43085
Conversation
A few notes that we will need to handle based on my trials at baronfel/sdk-container-demo#15
|
Or |
src/Containers/Microsoft.NET.Build.Containers/Tasks/ComputeDotnetBaseImageAndTag.cs
Show resolved
Hide resolved
src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs
Show resolved
Hide resolved
src/Containers/Microsoft.NET.Build.Containers/Registry/DefaultManifestOperations.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - it looks good and shippable.
I have some nonblocking comments for consideration. I'd recommend to remove code repetition and define strong return types - it'll help maintainability
src/Containers/Microsoft.NET.Build.Containers/ImageIndexGenerator.cs
Outdated
Show resolved
Hide resolved
src/Containers/Microsoft.NET.Build.Containers/ImageIndexGenerator.cs
Outdated
Show resolved
Hide resolved
src/Containers/Microsoft.NET.Build.Containers/ImageIndexGenerator.cs
Outdated
Show resolved
Hide resolved
src/Containers/Microsoft.NET.Build.Containers/Tasks/ComputeDotnetBaseImageAndTag.cs
Outdated
Show resolved
Hide resolved
src/Containers/Microsoft.NET.Build.Containers/Tasks/ComputeDotnetBaseImageAndTag.cs
Show resolved
Hide resolved
src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateImageIndex.cs
Outdated
Show resolved
Hide resolved
Very happy to merge this. Thank you for all of your work @surayya-MS, and for your deep review @SimaTian! |
Context
Fixes dotnet/sdk-container-builds#87. Currently, customers use our tooling to publish single architectural container images providing architecture via
RuntimeIdentifier
orContainerRuntimeIdentifier
properties. It's not possible to publish multi-architectural container image. This change allows customers to do that.Customer impact
With this change customers will be able to publish multi-arch container images to remote registries, or publish single-arch images for each architecture locally (either directly to docker/podman or as tarballs).
Details
It is not possible to create multi-arch image in
docker
because the individual images for each architecture must be available in the remote registry. Forpodman
it is possible, however, that is not part of these PR. It will be the next iteration.Changes
PublishContainer
target renamed to_PublishSingleContainer
_PublishMultiArchContainers
target that calls_PublishSingleContainer
for each arch and then creates image indexPublishContainer
target calls either_PublishSingleContainer
or_PublishMultiArchContainers
depending on a conditionCreateImageIndex
that creates the image index (manifest list it's same thing) and pushes to the remote registry.Testing
Risk
Low - the existing tests ensure that other scenarios were not affected.