umoci-insert(1)(#)
πΈ NAME πΈ
umoci insert β insert content into an OCI image π
okay bestie, real quick before we dive in: this is the umoci-insert(1) manual page, and it was written by Aleksa Sarai back in SEPTEMBER 2018 and it has been iconic ever since, no cap. π
β¨ SYNOPSIS β¨
umoci insert --image=image[:tag] [--tag=new-tag]
[--compress=compression-type] [--opaque] [--rootless] [--uid-map=value]
[--uid-map=value] [--no-history] [--history.comment=comment]
[--history.created_by=created_by] [--history.author=author] [--history-
created=date] source target
umoci insert [options] --whiteout target
π« DESCRIPTION π«
so there are two whole vibes this command can serve, and they are not the same vibe, so let's break it down. π¦
Form one, bestie: you insert the contents of source into the OCI image given by --image β and heads up, this overwrites it unless you specify --tag. How? By creating a whole new layer that contains just the contents of source, with a name of target. source can be either a file or a directory, and if it's a directory, bestie, it gets recursed. And if --opaque is specified, then any paths below target in the previous image layers (assuming target is a directory) will be removed. gone. deleted. π
Form two, also iconic: this inserts a "deletion entry" into the OCI image for target inside the image. It does that by inserting a layer containing just a whiteout entry for the given path. π«Ά
β οΈ okay this part is IMPORTANT, do not skip it. This command works by creating a new layer, so it should NOT be used to remove (or replace) secrets from an already-built image. Like, the secret is still in there. That's not a vibe. Seeumoci-config(1)and--config.volumefor how to achieve this correctly β by not creating image layers with secrets in the first place. periodt. π
Also: if --no-history was not specified, a history entry gets appended to the tagged OCI image for this change (with the various --history. flags controlling the values used). Wanna go look at the history? See umoci-stat(1). β¨
π OPTIONS π
The global options are defined in umoci(1). (iykyk π)
--image=image[:tag]β the source and destination tag for the insertion of file at path inside the container image.imagemust be a path to a valid OCI image andtagmust be a valid tag in the image. Iftagis not provided it defaults to"latest". π--tag=new-tagβ the tag name for the modified image. If unspecified, then the original tag you gave to--imagegets clobbered. bye bestie. π--compress=compression-typeβ specify the compression type to use when creating a new layer. The supported compression types arenone,gzip, andzstd. And good news:umoci-unpack(1)transparently supports all compression methods you can specify with--compress. π
The special value auto will cause umoci(1) to auto-select the most appropriate compression algorithm based on what previous layers are compressed with (it will try to use the most recent layer's compression algorithm which it supports). But note that auto will never select none compression automatically, as not compressing tar(1) archives is really not advisable. π«£
If no compression-type is provided, it defaults to auto.
--opaqueβ (assuming target is a directory.) Add an opaque whiteout entry for target so that any child path of target in previous layers is masked by the new entry for target, which will just contain the contents of source. This allows for the complete replacement of a directory, as opposed to the merging of directory entries. full glow-up for that directory fr fr β¨--whiteoutβ add a deletion entry for target, so that it is not present in future extractions of the image. πͺ¦--rootlessβ enable rootless insertion support. This allowsumoci-insert(1)to be used as an unprivileged user. Use of this flag implies--uid-map=0:$(id -u):1and--gid-map=0:$(id -g):1, as well as enabling several features to fake parts of the recursion process in an attempt to generate an as-close-as-possible clone of the filesystem for insertion. we love an accessible queen π--uid-map=valueβ specifies a UID mapping to use when inserting files. This is used in a similar fashion touser_namespaces(7), and is of the formcontainer:host[:size]. π§--gid-map=valueβ specifies a GID mapping to use when inserting files. This is used in a similar fashion touser_namespaces(7), and is of the formcontainer:host[:size]. π§--no-historyβ causes no history entry to be added for this operation. This is not recommended for use withumoci-insert(1), since it results in the history not including all of the image layers β and thus will cause confusion with tools that look at image history. like, imagine the drama π--history.comment=commentβ comment for the history entry corresponding to this modification of the image. If unspecified,umoci(1)will generate an implementation-dependent value. πΈ--history.created_by=created_byβ CreatedBy entry for the history entry corresponding to this modification of the image. If unspecified,umoci(1)will generate an implementation-dependent value. π--history.author=authorβ Author value for the history entry corresponding to this modification of the image. If unspecified, this value will be the image's author value after any modifications were made by this call ofumoci-config(1). β¨--history-created=dateβ creation date for the history entry corresponding to this modifications of the image. This must be an ISO8601 formatted timestamp (seedate(1)). If unspecified, the current time is used. β°
π EXAMPLE π
The following inserts a file mybinary into the path /usr/bin/mybinary and a directory myconfigdir into the path /etc/myconfigdir. And it should be noted that if /etc/myconfigdir already exists in the image, the contents of the two directories are merged (with the newer layer taking precedence). main character energy for the new layer honestly. π
% umoci insert --image oci:foo mybinary /usr/bin/mybinary
% umoci insert --image oci:foo myconfigdir /etc/myconfigdir
And in these examples we delete /usr/bin/mybinary and replace the entirety of /etc with myetcdir (such that none of the old /etc entries will be present on umoci-unpack(1)). π«’
% umoci insert --image oci:foo --whiteout /usr/bin/mybinary
% umoci insert --image oci:foo --opaque myetcdir /etc
π¦ SEE ALSO π¦
umoci(1), umoci-repack(1), umoci-raw-add-layer(1)
and that's the whole page bestie!! π this one came from the umoci manual set, page umoci-insert(1)(#), and the footer is literally just insert over umoci over umoci-insert(1)(#) β so go forth and insert things, you absolute legend. slay. π
β¨π
π¦ where this page comes from
- arch rolling: umoci 0.6.0-1 Β· Apache-2.0
- fedora 43: umoci 0.6.0-1.fc43 Β· Apache-2.0 AND MIT AND BSD-2-Clause AND BSD-3-Clause AND ISC
- fedora 44: umoci 0.6.0-3.fc44 Β· Apache-2.0 AND MIT AND BSD-2-Clause AND BSD-3-Clause AND ISC
- nixos 26.05: umoci 0.6.0
- nixpkgs unstable: umoci 0.6.0
- ubuntu stonking: umoci 0.6.0+ds-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms