github.com/opencontainers/umoci
v0.6.0
#1771 most downloaded on Go modules
opencontainers/umoci
What this package is like to depend on
Last release 5 months ago
15 Mar 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 14 of 14 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
905 releases · first in 2016
23 releases in the last 12 months
see the full history below
Release timeline
905 releases · Oct 2016 to Mar 2026Releases
latest 60 of 905-
v0.6.1-0.20260315131000-f5d1219acaf615 Mar 2026 pre-releaseNothing published for this version
-
v0.6.1-0.20260305060406-6e4e0aaa1caf05 Mar 2026 pre-releaseNothing published for this version
-
v0.6.1-0.20260110132243-2abf0e66c3eb10 Jan 2026 pre-releaseNothing published for this version
-
v0.6.1-0.20260110101421-28fd75cb0e2910 Jan 2026 pre-releaseNothing published for this version
-
v0.6.1-0.20251227141953-4e04bc50724327 Dec 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251221115419-8069b96b123421 Dec 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251213054154-70fc5ee1f4df13 Dec 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251209114903-d55a80471c1109 Dec 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251111195028-5c1a29e5446911 Nov 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251111052518-3e0f59e18d2811 Nov 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251110061129-607c29541ca410 Nov 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251105070021-a0b653cf084005 Nov 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251103062732-ac85339a8ccb03 Nov 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251031102227-13c7ab54c4f631 Oct 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251026095725-94413883fcdb26 Oct 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251024012326-f404574b38b624 Oct 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251016141358-d6313283c36516 Oct 2025 pre-releaseNothing published for this version
-
v0.6.1-0.20251015090152-8d053d66820a15 Oct 2025 pre-releaseNothing published for this version
-
v0.6.015 Oct 2025Release notes
Open source →This is a fairly major update to umoci.
This update to umoci includes support for v1.1.1 of the OCI image
specification. For the most part, this mostly involves supporting reading new
features added to the specification (such as embedded-data descriptors and
subject references used by OCI artifact images), but at the moment umoci does
not yet support creating images utilising these features.In addition, umoci also now supports generating
config.jsonblobs that are
compliant with v1.2.1 of the OCI runtime specification. Note that we do not
explicitly use any of the newer features, this is mostly a quality-of-life
update to move away from our ancient pinned version of the runtime-spec.Breaking
github.com/opencontainers/umoci/oci/config/generate.Generatorhas had the
following breaking API changes made to it:- The existing
ConfigExposedPortsandConfigVolumesmethods now return a
sorted[]stringinstead of amap. - The
(Set)OSand(Set)Architecturemethods have been renamed to have a
Platformprefix (to match image-spec v1.1's organisational changes). They
now read as(Set)PlatformOSand(Set)PlatformArchitecturerespectively.
- The existing
Added
-
umoci statnow includes information about the manifest and configuration of
the image, both in the regular and JSON-formatted outputs. -
umoci now has
SOURCE_DATE_EPOCHsupport, to attempt to
make it easier to create reproducible images. Our behaviour is modelled after
tar --clamp-mtime, meaning thatSOURCE_DATE_EPOCHwill only be used to
modify the timestamps of files newer thanSOURCE_DATE_EPOCH.As
umoci repackworks based on diffs, this also means that only files that
were modified (and will thus be usually be included in the new layer) will
have their timestamps rewritten.--history.createdandumoci config --createdwill also now default to
SOURCE_DATE_EPOCH(if set).With this change, umoci should be fairly compliant with reproducible builds.
Please let us know if you find any other problematic areas in umoci (we are
investigating some other possible causes of instability such as Go map
iteration). -
In order to avoid the need for a patched
gomtreepackage
that supports rootless mode, umoci now has aumoci raw mtree-validate
subcommand that implements the keygomtree validatefeatures we need for
our integration tests.Note that this subcommand is not intended for wider use outside of our tests
(and it is hidden from the help pages for a reason). Most users are probably
better off just usinggomtree. -
umoci --versionnow provides more information about the specification
versions supported by theumocibinary as well as the Go version used. -
umoci confignow supports specifying the architecture variant of the image
with--platform.variant. In addition,--osand--architecturecan now
be set using--platform.osand--platform.archrespectively. -
umoci newwill not automatically fill the architecture variant on ARM
systems to match the host CPU.
Changed
- The output format of
umoci stathas had some minor changes made to how
special characters are escaped and when quoting is carried out.
Fixed
- Some minor aspects of how
umoci statwould filter special characters in
history entries have been resolved. umoci repackwill now truncate themtimeof files added to the layer tar
archives. Previously, we would defer to the Go stdlib'sarchive/tarwhich
rounds to the nearest second (which is incompatible withgomtreeand so in
theory could lead to inconsistent results).- Previously, when generating the runtime-spec
config.json,umoci unpack
would incorrectly prioritise the automatically generated annotations over
explicitly configured labels. This precdence was the opposite of what the
image-spec requires, and has now been resolved.
Thanks to the following contributors for making this release possible:
- Aleksa Sarai [email protected]
- Danish Prakash [email protected]
Signed-off-by: Aleksa Sarai [email protected]
Release notes
Open source →Please mind the gap between the train and the platform.
This update to umoci includes support for v1.1.1 of the OCI image specification. For the most part, this mostly involves supporting reading new features added to the specification (such as embedded-data descriptors and subject references used by OCI artifact images), but at the moment umoci does not yet support creating images utilising these features.
In addition, umoci also now supports generating
config.jsonblobs that are compliant with v1.2.1 of the OCI runtime specification. Note that we do not explicitly use any of the newer features, this is mostly a quality-of-life update to move away from our ancient pinned version of the runtime-spec.Breaking
github.com/opencontainers/umoci/oci/config/generate.Generatorhas had the following breaking API changes made to it:- The existing
ConfigExposedPortsandConfigVolumesmethods now return a sorted[]stringinstead of amap. - The
(Set)OSand(Set)Architecturemethods have been renamed to have aPlatformprefix (to match image-spec v1.1's organisational changes). They now read as(Set)PlatformOSand(Set)PlatformArchitecturerespectively.
- The existing
Added
-
umoci statnow includes information about the manifest and configuration of the image, both in the regular and JSON-formatted outputs. -
umoci now has
SOURCE_DATE_EPOCHsupport, to attempt to make it easier to create reproducible images. Our behaviour is modelled aftertar --clamp-mtime, meaning thatSOURCE_DATE_EPOCHwill only be used to modify the timestamps of files newer thanSOURCE_DATE_EPOCH.As
umoci repackworks based on diffs, this also means that only files that were modified (and will thus be usually be included in the new layer) will have their timestamps rewritten.--history.createdandumoci config --createdwill also now default toSOURCE_DATE_EPOCH(if set).With this change, umoci should be fairly compliant with reproducible builds. Please let us know if you find any other problematic areas in umoci (we are investigating some other possible causes of instability such as Go map iteration).
-
In order to avoid the need for a patched
gomtreepackage that supports rootless mode, umoci now has aumoci raw mtree-validatesubcommand that implements the keygomtree validatefeatures we need for our integration tests.Note that this subcommand is not intended for wider use outside of our tests (and it is hidden from the help pages for a reason). Most users are probably better off just using
gomtree. -
umoci --versionnow provides more information about the specification versions supported by theumocibinary as well as the Go version used. -
umoci confignow supports specifying the architecture variant of the image with--platform.variant. In addition,--osand--architecturecan now be set using--platform.osand--platform.archrespectively. -
umoci newwill not automatically fill the architecture variant on ARM systems to match the host CPU.
Changed
- The output format of
umoci stathas had some minor changes made to how special characters are escaped and when quoting is carried out.
Fixed
- Some minor aspects of how
umoci statwould filter special characters in history entries have been resolved. umoci repackwill now truncate themtimeof files added to the layer tar archives. Previously, we would defer to the Go stdlib'sarchive/tarwhich rounds to the nearest second (which is incompatible withgomtreeand so in theory could lead to inconsistent results).- Previously, when generating the runtime-spec
config.json,umoci unpackwould incorrectly prioritise the automatically generated annotations over explicitly configured labels. This precdence was the opposite of what the image-spec requires, and has now been resolved.
Release notes
Open source →umoci v0.6.0 -- "Please mind the gap between the train and the platform." Latest
Latest
Compare
Choose a tag to compare
-
v0.5.2-0.20251004041049-bce0b020107704 Oct 2025 pre-releaseNothing published for this version
-
v0.5.2-0.20250912052559-f7489af3237012 Sep 2025 pre-releaseNothing published for this version
-
v0.5.2-0.20250906175908-95052c63437706 Sep 2025 pre-releaseNothing published for this version
-
v0.5.106 Sep 2025Release notes
Open source →This is a fairly minor update to umoci, containing a few bugfixes for
some potential issues, as well as finally removing the requirement for
oci-image-tool validation. We still do not support the latest image-spec
release, but decoupling for oci-image-tool is a very important first
step.Fixed
- For images with an empty
index.json, umoci will no longer incorrectly set
themanifestsentry tonull(which was technically a violation of the
specification, though such images cannot be pushed or interacted with outside
of umoci). - Based on some recent developments in the image-spec, umoci
will now produce an error if it encounters descriptors with a negative size
(this was a potential DoS vector previously) as well as a theoretical attack
where an attacker would endlessly write to a blob (this would not be
generally exploitable for images with descriptors).
Changed
-
We now use
go:embedto fill the version information ofumoci --version,
allowing for users to get a reasonable binary withgo install. However, we
still recommend using our official binaries, using distribution binaries, or
building from source withmake. -
Rather than using
oci-image-tool validatefor validating images in our
tests, we now make use of some hand-written smoke tests as well as the
jq-based validators maintained in docker-library/meta-scripts.This is intended to act as a stop-gap until
umoci validateis implemented
(and after that, we may choose to keep thejq-based validators as a
double-check that our own validators are working correctly).
Thanks to the following contributors who made this release possible:
- Adam Korcz [email protected]
- Akhil Mohan [email protected]
- Aleksa Sarai [email protected]
This release is dedicated to our cat Yuki who sadly passed away on
Friday. Most of the code I've written in the past four years was written
with him purring away on my chest, and he was the most loving cat I've
ever met. Rest in peace, little buddy. I hope you enjoyed your time with
us, and I'll always keep you in my heart. 🖤Signed-off-by: Aleksa Sarai [email protected]
Release notes
Open source →🖤 Yuki (2021-2025)
Fixed
- For images with an empty
index.json, umoci will no longer incorrectly set themanifestsentry tonull(which was technically a violation of the specification, though such images cannot be pushed or interacted with outside of umoci). - Based on some recent developments in the image-spec, umoci will now produce an error if it encounters descriptors with a negative size (this was a potential DoS vector previously) as well as a theoretical attack where an attacker would endlessly write to a blob (this would not be generally exploitable for images with descriptors).
Changed
-
We now use
go:embedto fill the version information ofumoci --version, allowing for users to get a reasonable binary withgo install. However, we still recommend using our official binaries, using distribution binaries, or building from source withmake. -
Rather than using
oci-image-tool validatefor validating images in our tests, we now make use of some hand-written smoke tests as well as thejq-based validators maintained in docker-library/meta-scripts.This is intended to act as a stop-gap until
umoci validateis implemented (and after that, we may choose to keep thejq-based validators as a double-check that our own validators are working correctly).
- For images with an empty
-
v0.5.1-0.20250530052646-8a7f7894daa430 May 2025 pre-releaseNothing published for this version
-
v0.5.1-0.20250521070104-9e77a0c13b6521 May 2025 pre-releaseNothing published for this version
-
v0.5.021 May 2025Release notes
Open source →This is a long-awaited release of umoci containing some Go API breaking
changes, some new features, and many other minor changes and
improvements.Note that the Go API is still considered to be unstable, so downstream
users should generally be aware that future updates may contain more
breaking changes until we release umoci v1.0.0. However, the umoci CLI
is considered to be stable (as it has been widely used for nearly a
decade now) and we will endeavour to not make breaking changes.This version of umoci requires Go 1.23 to build.
Security
- A security flaw was found in the OCI image-spec, where it is possible to
cause a blob with one media-type to be interpreted as a different media-type.
As umoci is not a registry nor does it handle signatures, this vulnerability
had no real impact on umoci but for safety we implemented the now-recommended
media-type embedding and verification. CVE-2021-41190
Breaking
-
The method of configuring the on-disk format and
MapOptionsin
RepackOptionsandUnpackOptionshas been changed. The on-disk format is
now represented with theOnDiskFormatinterface, withDirRootfsand
OverlayfsRootfsas possible options to use.MapOptionsis now configured
inside theOnDiskFormatsetting, which will require callers to adjust their
usage of the main umoci APIs. In particular, examples likeunpackOptions := &layer.UnpackOptions{ MapOptions: mapOptions, WhiteoutMode: layer.StandardOCIWhiteout, // or layer.OverlayFSWhiteout } err := layer.UnpackManifest(ctx, engineExt, bundle, manifest, unpackOptions)
will have to now be written as
unpackOptions := &layer.UnpackOptions{ OnDiskFormat: layer.DirRootfs{ // or layer.OverlayfsRootfs MapOptions: mapOptions, }, } err := layer.UnpackManifest(ctx, engineExt, bundle, manifest, unpackOptions)
and similarly
repackOptions := &layer.RepackOptions{ MapOptions: mapOptions, TranslateOverlayWhiteouts: false, // or true } layerRdr, err := layer.GenerateLayer(path, deltas, repackOptions)
will have to now be written as
repackOptions := &layer.RepackOptions{ OnDiskFormat: layer.DirRootfs{ // or layer.OverlayfsRootfs MapOptions: mapOptions, }, } layerRdr, err := layer.GenerateLayer(path, deltas, repackOptions)
Note that this means you can easily re-use the
OnDiskFormatconfiguration
between bothUnpackOptionsandRepackOptions, removing the previous need
to translate betweenWhiteoutModeandTranslateOverlayWhiteouts.For users of the API that need to extract the
MapOptionsfrom
UnpackOptionsandRepackOptions, there is a new helperMapOptionswhich
will help extract it without doing interface type switching. For
OnDiskFormatthere is also aMapmethod that gives you the inner
MapOptionsregardless of type. -
layer.NewTarExtractornow takes*UnpackOptionsrather than
UnpackOptionsto match the signatures of the otherlayer.*APIs. Passing
nilis equivalent to passing&UnpackOptions{}. -
In umoci 0.4.7, we added support for overlayfs unpacking using the
still-unstable Go API. However, the implementation is still missing some key
features and so we will now return errors from APIs that are still missing
key features:-
layer.UnpackManifestandlayer.UnpackRootfswill now return an error
ifUnpackOptions.OnDiskFormatis set to anything other thanDirRootfs
(the default, equivalent toWhiteoutModebeing set to
OCIStandardWhiteoutin umoci 0.4.7).This is because bundle-based unpacking currently tries to unpack all
layers into the samerootfsand generate anmtreemanifest -- this
doesn't make sense for overlayfs-style unpacking and will produce garbage
bundles as a result. As such, we expect that nobody actually made use of
this feature (otherwise we would've seen bug reports complaining about it
being completely broken in the past 4 years). opencontainers/umoci#574
tracks re-enabling this feature (and exposing to umoci CLI users, if
possible).Note that
layer.UnpackLayerstill supportsOverlayfsRootfs
(OverlayFSWhiteoutin umoci 0.4.7). -
Already-extracted bundles with
OverlayfsRootfs(OverlayFSWhiteoutin
umoci 0.4.7) will now return an error when umoci operates on
them -- we included the whiteout mode in ourumoci.jsonbut as the
feature is broken, umoci will now refuse to operate on such bundles. Such
bundles could only have been created using the now-error-inducing
UnpackRootfsandUnpackManifestAPIs mentioned above, and as mentioned
above we expect there to have been no real users of this feature.Note that this only affects extracted bundles (a-la
umoci unpack).
Images created from such bundles are unaffected (even though their
contents probably should be audited, since the implementation of this
feature was quite broken in this usecase).
Users should expect more breaking changes in the overlayfs-related Go APIs in
a future umoci 0.6 release, as there is still a lot of work left to do. -
Added
umoci unpacknow supports handling layers compressed with zstd. This is
something that was added in image-spec v1.2 (which we do not yet support
fully) but at least this will allow users to operate on zstd-compressed
images, which are slowly becoming more common.umoci repackandumoci insertnow support creating zstd-compressed
layers. The default behaviour (calledauto) is to try to match the last
layer's compression algorithm, with a fallback togzipif none of the layer
algorithms were supported.- Users can specify their preferred compression algorithm using the new
--compressflag. You can also disable compression entirely using
--compress=nonebut--compress=autowill never automatically choose
nonecompression.
- Users can specify their preferred compression algorithm using the new
GenerateLayerandGenerateInsertLayerwithOverlayfsRootfs
(calledTranslateOverlayWhiteoutsin umoci 0.4.7) now support
convertingtrusted.overlay.opaque=yandtrusted.overlay.whiteout
whiteouts into OCI whiteouts when generating OCI layers.OverlayfsRootfsnow supports compatibility with theuserxattrmount
option for overlayfs (whereuser.overlay.*xattrs are used rather than
the defaulttrusted.overlay.*). This is a pretty key compatibility feature
for users that use unprivileged overlayfs mounts and will hopefully remove
the need for most downstream forks hacking in this functionality (such as
stacker). For Go API users, to enable this just setUserXattr: truein
OverlayfsRootfs. Note that (as with upstream overlayfs), only one xattr
namespace is ever used (so ifOverlayfsRootfs.UserXattr == truethen
trusted.overlay.*xattrs will be treated like any other non-overlayfs
xattr).
Changes
- In this release, the primary development branch was renamed to
main. - The runtime-spec version of the
config.jsonversion we generate is no
longer hard-coded to1.0.0. We now use the version of the spec we have
imported (with any-devsuffix stripped, as such a prefix causes havoc with
verification tools -- ideally we would only ever use released versions of the
spec but that's not always possible). #452 - Add the
cgroupnamespace to the default configuration generated byumoci unpackto make sure that our configuration plays nicely withruncwhen on
cgroupv2 systems. - umoci has been migrated away from
github.com/pkg/errorsto Go stdlib error
wrapping. - The gzip compression block size has been updated to be more friendly with
Docker and other tools that might round-trip the layer blob data (causing the
hash to change if the block size is different). #509
Fixed
- In 0.4.7, a performance regression was introduced as part of the
VerifiedReadCloserhardening work (to read all trailing bytes) which would
cause walk operations on images to hash every blob in the image (even blobs
which we couldn't parse and thus couldn't recurse into). To resolve this, we
no longer recurse into unparseable blobs. #373 #375 #394 - Handle
EINTRonio.Copyoperations. Newer Go versions have added more
opportunistic pre-emption which can causeEINTRerrors in io paths that
didn't occur before. #437 - Quite a few changes were made to CI to try to avoid issues with fragility.
#452 - umoci will now return an explicit error if you pass invalid uid or gid values
to--uid-mapand--gid-maprather than silently truncating the value. - For Go users of umoci,
GenerateLayer(but notGenerateInsertLayer) with
OverlayfsRootfs(calledTranslateOverlayWhiteoutsin umoci
0.4.7) had several severe bugs that made the feature unusable:- All OCI whiteouts added to the archive would incorrectly have the full host
name of the path rather than the correctly rooted path, making the whiteout
practically useless. - Any non-whiteout files would not be included in the layer, making the layer
data incomplete and thus resulting in silent data loss.
Given how severe these bugs were and the lack of bug reports of this issue in
the past 4 years, it seems this feature has not really been used by anyone (I
hope...).
- All OCI whiteouts added to the archive would incorrectly have the full host
- For Go users of umoci,
UnpackLayernow correctly handles several aspects of
OverlayfsRootfs(OverlayFSWhiteoutin umoci 0.4.7) extraction
that weren't handled correctly:- Unlike regular extractions, overlayfs-style extractions require us to
create the parent directory of the whiteout (rather than ignoring or
assuming the underlying path exists) because the whiteout is being created
in a separate layer to the underlying file. We also need to make sure that
opaque whiteout targets are directories. trusted.overlay.opaque=yhas very peculiar behaviour when a regular
whiteout (i.e.mknod c 0 0) is placed inside an opaque directory -- the
whiteout-ed file appears inreaddirbut the file itself doesn't exist. To
avoid this confusion (and possible information leak), umoci will no longer
extract plain whiteouts within an opaque whiteout directory in the same
layer. (As per the OCI spec requirements, this is regardless of the order
of the opaque whiteout and the regular whiteout in the layer archive.)
- Unlike regular extractions, overlayfs-style extractions require us to
UnpackLayerandGenerate(Insert)Layernow correctly handle
trusted.overlay.*xattr escaping when extracting and generating layers with
the overlayfs on-disk format. This escaping feature has been supported by
overlayfs since Linux 6.7, and
allows for you to created images that contain an overlayfs layout inside the
image (nested to arbitrary levels).- If an image contains
trusted.overlay.*xattrs,UnpackLayerwill
rewrite the xattrs to instead be in thetrusted.overlay.overlay.*
namespace, so that when merged using overlayfs the user will see the
expected xattrs. - If an on-disk overlayfs directory used with
Generate(Insert)Layer
contains escapedtrusted.overlay.overlay.*xattrs, they will be rewritten
so that the generated layer containstrusted.overlay.*xattrs. If we
encounter an unescapedtrusted.overlay.*xattr they will not be included
in the image (though they may cause the file to be converted to a whiteout
in the image) because they are considered to be an internal aspect of the
host on-disk format (i.e.trusted.overlay.originmight be automatically
set by whatever tool is using the overlayfs layers).
Note that in the regular extraction mode, these xattrs will be treated like
any other xattrs (this is in contrast to the previous behaviour where they
would be silently ignored regardless of the on-disk format being used).
- If an image contains
- When extracting a layer,
umoci unpackwould previously return an error if a
tar entry was within a non-directory. In practice such cases are quite
unlikely (as layer diffs would usually include an entry changing the type of
the non-directory parent) but this could result in spurious errors with
somewhat non-standard tar archive layers. Now, umoci will remove the
offending non-directory parent component and re-create the parent path as a
proper directory tree.- This also has the side-effect of fixing the behaviour when unpacking
whiteouts with theOverlayfsRootfson-disk format. If there is a plain
whiteout of a regular directory, followed by parent components being made
underneath that directory, then the directory should be converted to an
opaque whiteout. This matches the behaviour of overlayfs (though again, it
seems unlikely that a layer diff tool would generate such a layer).
#546
- This also has the side-effect of fixing the behaviour when unpacking
Thanks to all of the following contributors for making this release
possible:- AdamKorcz [email protected]
- Aleksa Sarai [email protected]
- Bibhas [email protected]
- Cameron Nemo [email protected]
- Michael McCracken [email protected]
- Ramkumar Chinchani [email protected]
- Serge Hallyn [email protected]
- Shengjing Zhu [email protected]
- Tycho Andersen [email protected]
- guoguangwu [email protected]
Signed-off-by: Aleksa Sarai [email protected]
Release notes
Open source →A wizard is never late, Frodo Baggins. Nor is he early; he arrives precisely when he means to.
This version of umoci requires Go 1.23 to build.
Security
- A security flaw was found in the OCI image-spec, where it is possible to cause a blob with one media-type to be interpreted as a different media-type. As umoci is not a registry nor does it handle signatures, this vulnerability had no real impact on umoci but for safety we implemented the now-recommended media-type embedding and verification. CVE-2021-41190
Breaking
-
The method of configuring the on-disk format and
MapOptionsinRepackOptionsandUnpackOptionshas been changed. The on-disk format is now represented with theOnDiskFormatinterface, withDirRootfsandOverlayfsRootfsas possible options to use.MapOptionsis now configured inside theOnDiskFormatsetting, which will require callers to adjust their usage of the main umoci APIs. In particular, examples likeunpackOptions := &layer.UnpackOptions{ MapOptions: mapOptions, WhiteoutMode: layer.StandardOCIWhiteout, // or layer.OverlayFSWhiteout } err := layer.UnpackManifest(ctx, engineExt, bundle, manifest, unpackOptions)will have to now be written as
unpackOptions := &layer.UnpackOptions{ OnDiskFormat: layer.DirRootfs{ // or layer.OverlayfsRootfs MapOptions: mapOptions, }, } err := layer.UnpackManifest(ctx, engineExt, bundle, manifest, unpackOptions)and similarly
repackOptions := &layer.RepackOptions{ MapOptions: mapOptions, TranslateOverlayWhiteouts: false, // or true } layerRdr, err := layer.GenerateLayer(path, deltas, repackOptions)will have to now be written as
repackOptions := &layer.RepackOptions{ OnDiskFormat: layer.DirRootfs{ // or layer.OverlayfsRootfs MapOptions: mapOptions, }, } layerRdr, err := layer.GenerateLayer(path, deltas, repackOptions)Note that this means you can easily re-use the
OnDiskFormatconfiguration between bothUnpackOptionsandRepackOptions, removing the previous need to translate betweenWhiteoutModeandTranslateOverlayWhiteouts.For users of the API that need to extract the
MapOptionsfromUnpackOptionsandRepackOptions, there is a new helperMapOptionswhich will help extract it without doing interface type switching. ForOnDiskFormatthere is also aMapmethod that gives you the innerMapOptionsregardless of type. -
layer.NewTarExtractornow takes*UnpackOptionsrather thanUnpackOptionsto match the signatures of the otherlayer.*APIs. Passingnilis equivalent to passing&UnpackOptions{}. -
In umoci 0.4.7, we added support for overlayfs unpacking using the still-unstable Go API. However, the implementation is still missing some key features and so we will now return errors from APIs that are still missing key features:
-
layer.UnpackManifestandlayer.UnpackRootfswill now return an error ifUnpackOptions.OnDiskFormatis set to anything other thanDirRootfs(the default, equivalent toWhiteoutModebeing set toOCIStandardWhiteoutin umoci 0.4.7).This is because bundle-based unpacking currently tries to unpack all layers into the same
rootfsand generate anmtreemanifest -- this doesn't make sense for overlayfs-style unpacking and will produce garbage bundles as a result. As such, we expect that nobody actually made use of this feature (otherwise we would've seen bug reports complaining about it being completely broken in the past 4 years). opencontainers/umoci#574 tracks re-enabling this feature (and exposing to umoci CLI users, if possible).Note that
layer.UnpackLayerstill supportsOverlayfsRootfs(OverlayFSWhiteoutin umoci 0.4.7). -
Already-extracted bundles with
OverlayfsRootfs(OverlayFSWhiteoutin umoci 0.4.7) will now return an error when umoci operates on them -- we included the whiteout mode in ourumoci.jsonbut as the feature is broken, umoci will now refuse to operate on such bundles. Such bundles could only have been created using the now-error-inducingUnpackRootfsandUnpackManifestAPIs mentioned above, and as mentioned above we expect there to have been no real users of this feature.Note that this only affects extracted bundles (a-la
umoci unpack). Images created from such bundles are unaffected (even though their contents probably should be audited, since the implementation of this feature was quite broken in this usecase).
Users should expect more breaking changes in the overlayfs-related Go APIs in a future umoci 0.6 release, as there is still a lot of work left to do.
-
Added
umoci unpacknow supports handling layers compressed with zstd. This is something that was added in image-spec v1.2 (which we do not yet support fully) but at least this will allow users to operate on zstd-compressed images, which are slowly becoming more common.umoci repackandumoci insertnow support creating zstd-compressed layers. The default behaviour (calledauto) is to try to match the last layer's compression algorithm, with a fallback togzipif none of the layer algorithms were supported.- Users can specify their preferred compression algorithm using the new
--compressflag. You can also disable compression entirely using--compress=nonebut--compress=autowill never automatically choosenonecompression.
- Users can specify their preferred compression algorithm using the new
GenerateLayerandGenerateInsertLayerwithOverlayfsRootfs(calledTranslateOverlayWhiteoutsin umoci 0.4.7) now support convertingtrusted.overlay.opaque=yandtrusted.overlay.whiteoutwhiteouts into OCI whiteouts when generating OCI layers.OverlayfsRootfsnow supports compatibility with theuserxattrmount option for overlayfs (whereuser.overlay.*xattrs are used rather than the defaulttrusted.overlay.*). This is a pretty key compatibility feature for users that use unprivileged overlayfs mounts and will hopefully remove the need for most downstream forks hacking in this functionality (such as stacker). For Go API users, to enable this just setUserXattr: trueinOverlayfsRootfs. Note that (as with upstream overlayfs), only one xattr namespace is ever used (so ifOverlayfsRootfs.UserXattr == truethentrusted.overlay.*xattrs will be treated like any other non-overlayfs xattr).
Changes
- In this release, the primary development branch was renamed to
main. - The runtime-spec version of the
config.jsonversion we generate is no longer hard-coded to1.0.0. We now use the version of the spec we have imported (with any-devsuffix stripped, as such a prefix causes havoc with verification tools -- ideally we would only ever use released versions of the spec but that's not always possible). #452 - Add the
cgroupnamespace to the default configuration generated byumoci unpackto make sure that our configuration plays nicely withruncwhen on cgroupv2 systems. - umoci has been migrated away from
github.com/pkg/errorsto Go stdlib error wrapping. - The gzip compression block size has been updated to be more friendly with Docker and other tools that might round-trip the layer blob data (causing the hash to change if the block size is different). #509
Fixed
- In 0.4.7, a performance regression was introduced as part of the
VerifiedReadCloserhardening work (to read all trailing bytes) which would cause walk operations on images to hash every blob in the image (even blobs which we couldn't parse and thus couldn't recurse into). To resolve this, we no longer recurse into unparseable blobs. #373 #375 #394 - Handle
EINTRonio.Copyoperations. Newer Go versions have added more opportunistic pre-emption which can causeEINTRerrors in io paths that didn't occur before. #437 - Quite a few changes were made to CI to try to avoid issues with fragility. #452
- umoci will now return an explicit error if you pass invalid uid or gid values
to
--uid-mapand--gid-maprather than silently truncating the value. - For Go users of umoci,
GenerateLayer(but notGenerateInsertLayer) withOverlayfsRootfs(calledTranslateOverlayWhiteoutsin umoci 0.4.7) had several severe bugs that made the feature unusable:- All OCI whiteouts added to the archive would incorrectly have the full host name of the path rather than the correctly rooted path, making the whiteout practically useless.
- Any non-whiteout files would not be included in the layer, making the layer data incomplete and thus resulting in silent data loss. Given how severe these bugs were and the lack of bug reports of this issue in the past 4 years, it seems this feature has not really been used by anyone (I hope...).
- For Go users of umoci,
UnpackLayernow correctly handles several aspects ofOverlayfsRootfs(OverlayFSWhiteoutin umoci 0.4.7) extraction that weren't handled correctly:- Unlike regular extractions, overlayfs-style extractions require us to create the parent directory of the whiteout (rather than ignoring or assuming the underlying path exists) because the whiteout is being created in a separate layer to the underlying file. We also need to make sure that opaque whiteout targets are directories.
trusted.overlay.opaque=yhas very peculiar behaviour when a regular whiteout (i.e.mknod c 0 0) is placed inside an opaque directory -- the whiteout-ed file appears inreaddirbut the file itself doesn't exist. To avoid this confusion (and possible information leak), umoci will no longer extract plain whiteouts within an opaque whiteout directory in the same layer. (As per the OCI spec requirements, this is regardless of the order of the opaque whiteout and the regular whiteout in the layer archive.)
UnpackLayerandGenerate(Insert)Layernow correctly handletrusted.overlay.*xattr escaping when extracting and generating layers with the overlayfs on-disk format. This escaping feature has been supported by overlayfs since Linux 6.7, and allows for you to created images that contain an overlayfs layout inside the image (nested to arbitrary levels).- If an image contains
trusted.overlay.*xattrs,UnpackLayerwill rewrite the xattrs to instead be in thetrusted.overlay.overlay.*namespace, so that when merged using overlayfs the user will see the expected xattrs. - If an on-disk overlayfs directory used with
Generate(Insert)Layercontains escapedtrusted.overlay.overlay.*xattrs, they will be rewritten so that the generated layer containstrusted.overlay.*xattrs. If we encounter an unescapedtrusted.overlay.*xattr they will not be included in the image (though they may cause the file to be converted to a whiteout in the image) because they are considered to be an internal aspect of the host on-disk format (i.e.trusted.overlay.originmight be automatically set by whatever tool is using the overlayfs layers). Note that in the regular extraction mode, these xattrs will be treated like any other xattrs (this is in contrast to the previous behaviour where they would be silently ignored regardless of the on-disk format being used).
- If an image contains
- When extracting a layer,
umoci unpackwould previously return an error if a tar entry was within a non-directory. In practice such cases are quite unlikely (as layer diffs would usually include an entry changing the type of the non-directory parent) but this could result in spurious errors with somewhat non-standard tar archive layers. Now, umoci will remove the offending non-directory parent component and re-create the parent path as a proper directory tree.- This also has the side-effect of fixing the behaviour when unpacking
whiteouts with the
OverlayfsRootfson-disk format. If there is a plain whiteout of a regular directory, followed by parent components being made underneath that directory, then the directory should be converted to an opaque whiteout. This matches the behaviour of overlayfs (though again, it seems unlikely that a layer diff tool would generate such a layer). opencontainers/umoci#546
- This also has the side-effect of fixing the behaviour when unpacking
whiteouts with the
Release notes
Open source →umoci 0.5.0 -- "A wizard is never late, Frodo Baggins. Nor is he early; he arrives precisely when he means to."
Compare
Choose a tag to compare
- A security flaw was found in the OCI image-spec, where it is possible to
-
v0.4.8-0.20250507132620-0c0dc790a0c907 May 2025 pre-releaseNothing published for this version
-
v0.4.8-0.20241129064525-8f807a31798529 Nov 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20241128103930-cddb884c964b28 Nov 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20241128021600-3974679718aa28 Nov 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20241127143056-d2ba031d16e727 Nov 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20240909121406-afceb4b039de09 Sep 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20240708134804-ff684ba24c8608 Jul 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20240705070953-f118e398a53505 Jul 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20240508124516-656e4836fb0d08 May 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20240306125805-0a7d3ec8707706 Mar 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20240222142725-c0fdcb5e291822 Feb 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20240124010538-909d14011b8524 Jan 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20240105082514-a822fe06647105 Jan 2024 pre-releaseNothing published for this version
-
v0.4.8-0.20230920134428-7dc114a520bc20 Sep 2023 pre-releaseNothing published for this version
-
v0.4.8-0.20230721075647-f74280bc7da221 Jul 2023 pre-releaseNothing published for this version
-
v0.4.8-0.20230709102142-389cddbde82809 Jul 2023 pre-releaseNothing published for this version
-
v0.4.8-0.20230603012031-33ec00665c6603 Jun 2023 pre-releaseNothing published for this version
-
v0.4.8-0.20230419055027-de9ad9445da019 Apr 2023 pre-releaseNothing published for this version
-
v0.4.8-0.20221029002459-fb2db51251ac29 Oct 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220518071243-4270d5bfcfdb18 May 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220516065707-db97609dd3bd16 May 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220512061325-d8f4f12f989c12 May 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220511021639-21632238b33611 May 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220511021635-aab35e4efa1b11 May 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220427134139-90f64d5a2c8427 Apr 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220427041249-9db1db9b678827 Apr 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220427040854-413e54a901cc27 Apr 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220427040733-4f66890e71a327 Apr 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220427040619-1e4191cf2bd327 Apr 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220412110854-c20d1ba62a1012 Apr 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220412110845-defa147653fe12 Apr 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220412065249-d7c6b89e3d6612 Apr 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220412065115-12453f24774912 Apr 2022 pre-releaseNothing published for this version
-
v0.4.8-0.20220412062508-e76ee78798dc12 Apr 2022 pre-releaseNothing published for this version