You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support zstd compression for oci/docker image layers #52244
Is your feature request related to a problem? Please describe.
I am currently updating my build tooling to use the dotnet SDK to build and publish containers. So far this has been excellent and easy to use.
Docker recently announced that their hardened images are now free. I attempted to use the hardened image by setting the ContainerBaseImage property in my csproj
After reviewing the code base I found the SchemaTypes class does not have the given media type - and can see two locations in code where this can cause the error to be thrown
To have support added for the application/vnd.oci.image.layer.v1.tar+zstd media type so that the hardened images can be used within the container build features of the SDK.
Additional context
Despite targeting a net8 build I am using the 10.0.100 sdk
Reacted by Giorgi Chakhidze, Stuart Lang and Mattias Karlsson
Thanks for reporting - the underlying request here is for us to support zstd compression, so we'll have to check if this is something the Runtime supports yet. EDIT: It doesn't, I've linked this request to that issue for tracking.
There's another path we could go down here - we don't actually need to be able to decompress/compress the zstd layers, we only need to be able to download them and potentially push them elsewhere. We may be able to 'support' the consumption of zstd images just by treating the layers as opaque blobs.
The only compression mode we'd support for the layers we create for apps would be GZip, but since it's possible to mix and match layer media types this shouldn't be a problem at all.
@baronfel That is the approach I would suggest as a container ecosystem contributor/maintainer; there is nothing wrong with mixing-and-matching (though I'd encourage picking one of OCI or Docker mediaTypes for a given manifest; technically you can mix and match those too, but some tools don't handle it gracefully) mediaTypes.
Any progress? I ran into this with <ContainerBaseImage>dhi.io/aspnetcore:10.0</ContainerBaseImage>. Strangely it works on our CI (linux/amd64) and fails locally (darwin/arm64) although both use application/vnd.oci.image.layer.v1.tar+zstd according to the platform manifests.
We use Aspire with AddProject so using a Dockerfile as alternative would technically be possible with DHI but would also mean that for publishing we need to use AddDockerfile instead.
Activity
baronfel commentedon Dec 18, 2025
Thanks for reporting - the underlying request here is for us to support zstd compression, so we'll have to check if this is something the Runtime supports yet. EDIT: It doesn't, I've linked this request to that issue for tracking.
[-]Support latest media types for oci/docker builds[/-][+]Support zstd compression for oci/docker image layers[/+]baronfel commentedon Dec 19, 2025
There's another path we could go down here - we don't actually need to be able to decompress/compress the zstd layers, we only need to be able to download them and potentially push them elsewhere. We may be able to 'support' the consumption of zstd images just by treating the layers as opaque blobs.
The only compression mode we'd support for the layers we create for apps would be GZip, but since it's possible to mix and match layer media types this shouldn't be a problem at all.
neersighted commentedon Dec 19, 2025
@baronfel That is the approach I would suggest as a container ecosystem contributor/maintainer; there is nothing wrong with mixing-and-matching (though I'd encourage picking one of OCI or Docker mediaTypes for a given manifest; technically you can mix and match those too, but some tools don't handle it gracefully) mediaTypes.
baronfel commentedon Dec 19, 2025
Thanks for the validation @neersighted ! I've got a copilot PR out for this now that should have us compatible soon :)
We definitely need to do some consolidation here - I think we've got an issue tracking the is already, but if not I'll get one created.
Falco20019 commentedon Sep 8, 2026
Any progress? I ran into this with
<ContainerBaseImage>dhi.io/aspnetcore:10.0</ContainerBaseImage>. Strangely it works on our CI (linux/amd64) and fails locally (darwin/arm64) although both useapplication/vnd.oci.image.layer.v1.tar+zstdaccording to the platform manifests.We use Aspire with
AddProjectso using aDockerfileas alternative would technically be possible with DHI but would also mean that for publishing we need to useAddDockerfileinstead.ScottRosenberg2 commentedon Oct 20, 2026
Dotnet 11 adds support for zstd, so maybe this should be re-evaluated for 11.