Instead of a single path, the core should accept a packing specification when packing an image. This packing specification should allow for specifying filesystem mappings from which to build the image.
As a trivial example, the single path case would create a mapping from that path to / in the image.
A more complicated example might be:
./bin -> /
./assets -> / # Should flatten both ./bin/ and ./assets/ to image root
./subdir -> /different_dir
./abc/(.*)/(.*)/xyz -> /$1_$2.xyz # Some sort of path rewriting, possibly regex
Where the host paths are offset relative to some provided base path, separate from the spec. In practice this could be the current working directory, or the directory containing the spec file, if the spec came from a file.
The specification struct should have some sort of validator, and should be serializable/deserializable via serde if available.
Instead of a single path, the core should accept a packing specification when packing an image. This packing specification should allow for specifying filesystem mappings from which to build the image.
As a trivial example, the single path case would create a mapping from that path to
/
in the image.A more complicated example might be:
Where the host paths are offset relative to some provided base path, separate from the spec. In practice this could be the current working directory, or the directory containing the spec file, if the spec came from a file.
The specification struct should have some sort of validator, and should be serializable/deserializable via serde if available.