Repository navigation
[release/17.0] Make layered .NET container archives match SDK archive output - #22672
Jose Perez Rodriguez (joperezr) merged 3 commits into
Conversation
PublishWithContainerFiles archives now support OCI on Docker 25+, use the SDK's <name>.tar.gz directory naming, and are written as uncompressed tar like the SDK. Fixes #22591 Co-authored-by: Copilot App <[email protected]>
…sions Aspire now resolves a directory OutputPath to <flattened-image-name>.tar and passes the SDK an explicit archive file, so SDK-only and layered publishing write the same file regardless of the SDK's own path rules. Existing directories stay directories. Explicit .gz/.tgz archive names log a warning because the archive is an uncompressed tar. Co-authored-by: Copilot App <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22672Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22672" |
This comment has been minimized.
This comment has been minimized.
Servicing keeps the existing directory OutputPath file name so this backport is not a breaking change. Only explicitly chosen .gz/.tgz archive names log the uncompressed-tar warning, since the default directory name ends in .tar.gz. Co-authored-by: Copilot App <[email protected]>
Tests selector52 / 101 PR test projects · 4 PR jobs, from 8 changed files. Selected PR test projects (52 / 101)
Selected PR jobs (4)
How these were chosen — grouped by what changed
🔧 show 46
🧪 📦 affected project 📦 affected project 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Mitch Denny (mitchdenny)
left a comment
There was a problem hiding this comment.
Would be good to get this into Aspire 17.0.1
|
These are the 2 product code changes between #22666 and this PR: Left is
|
0298f3a
into
release/17.0
|
✅ No documentation update needed. excluded → backport (exclusion_reasons: base_branch_is_release, head_branch_is_backport, title_release_prefix, body_backport_marker). This is a backport of #22666; docs belong with the forward PR. Triggered signals: integration_readme_changed (src/Aspire.Hosting.Dotnet/README.md), pr_body_has_breaking_change_marker, pr_body_has_cli_flag_mention. |


Backport of #22666 to release/17.0
/cc Eric Erhardt (@eerhardt)
Differs from main: this backport keeps the .NET SDK's
<repository>.tar.gzfile name for a directoryOutputPath, so it is not a breaking change in 17.0.x. The<image>.tarrename and name flattening (labeledbreaking-changein #22666) ship only inmain. Because the default directory name ends in.tar.gz, the uncompressed-archive warning fires only for explicitly chosen.gz/.tgzfile names.Customer Impact
Customers who publish a .NET project to an image archive (
Destination = ContainerImageDestination.Archive) and also usePublishWithContainerFiles(for example, to copy a Vite frontend intowwwroot) get a different archive than without container files, so tools that consume it break (#22591):ImageFormat = Ocifails on Docker with "Docker cannot export an OCI archive...", even though Docker Engine 25+ writes OCI layouts.OutputPathproduces<name>-<tag>.tarinstead of the SDK's<name>.tar.gz..tar.gzpath is gzip-compressed only when layered, so OCI-layout tools such asoras cp --from-oci-layoutfail withinvalid tar header.Separately,
ContainerImageReferencereturned a nonexistent<name>-<tag>.tarpath for .NET projects with a directoryOutputPath, even without container files.Testing
Unit tests added or updated in
DockerContainerRuntimeTests,DotnetProgramArchiveTests,DotnetProgramPublishingTests, andResourceContainerImageManagerTestscover OCI save on Docker, layered and non-layered builds resolving to the same<repository>.tar.gzpath, uncompressed output, existing dotted directories, and the.gzwarning.On the backport branch, the 198 targeted Aspire.Hosting.Tests pass. The full Aspire.Hosting.Dotnet.Tests suite has 498 passing; 5 real-container tests there and 2 Dockerfile-build tests in Aspire.Hosting.Tests couldn't run locally because Docker wasn't running. They passed with Docker on the main PR (#22666). Manually verified that
docker image saveon Docker 29.9.3 writesoci-layoutandindex.json.Risk
Low. The change is limited to .NET project archive publishing (
Destination = Archive), with no public API changes. Archives from builds without container files keep 17.0's file name and format. Layered archives change name and compression to match the SDK, which is the bug fix. Explicit.gz/.tgzfile names now log a warning.Regression?
No. The OCI rejection, the layered naming, and the gzip behavior are all present in 13.6.5 (introduced with #19997).