Skip to content

image: Let copy() copy the tree of a layer - #446

Merged
martinpitt merged 1 commit into
amutable:mainfrom
daandemeyer:copy-layer
Nov 30, 2026
Merged

martinpitt merged 1 commit into
amutable:mainfrom
daandemeyer:copy-layer

Conversation

@daandemeyer

@daandemeyer daandemeyer commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

A project that wants the tree of one layer inside another image has to
build an image.archive() of the layer and extract it with tar in a run
operation, which needs tar in the tools box. A copy() of the layer copies
the top snapshot store of the layer instead, which is of no use in an image.

Let's have copy() take a layer and restore the snapshot of the layer at the
destination, with the modes, extended attributes and hardlinks it has in the
layer. A label in copy() is now a dependency rather than a source, so that we
can tell a layer from other targets. A product such as a DDI also provides
ImageInfo, so we mark a layer with a provider of its own, and copy() still
copies a product as a file.

A project that wants the tree of one layer inside another image has to
build an image.archive() of the layer and extract it with tar in a run
operation, which needs tar in the tools box. A copy() of the layer copies
the top snapshot store of the layer instead, which is of no use in an image.

Let's have copy() take a layer and restore the snapshot of the layer at the
destination, with the modes, extended attributes and hardlinks it has in the
layer. A label in copy() is now a dependency rather than a source, so that we
can tell a layer from other targets. A product such as a DDI also provides
ImageInfo, so we mark a layer with a provider of its own, and copy() still
copies a product as a file.

Signed-off-by: Daan De Meyer <daan@amutable.com>

@martinpitt martinpitt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very abstract, but I trust you know what it's good for. Thanks!

@martinpitt
martinpitt merged commit 451fec9 into amutable:main Nov 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants