forked from containers/composefs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I'm looking at storing OCI container images with their metadata included in the image - giving a "single file" holding all the relevant bits for an image. Specifically a structure like this: ``` /manifest.json /config.json /rootfs ``` I want higher level tooling to be able to read the metadata efficiently. Of course we could directly parse the EROFS image...but a lot of pitfalls there. We could also mount the image but that's pretty inefficient for this. Add support for filtering when generating a dump; this can operate fully unprivileged, and only requires some minor modifications to the library and CLI tooling. Signed-off-by: Colin Walters <[email protected]>
- Loading branch information
Showing
7 changed files
with
158 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
BINDIR="$1" | ||
ASSET_DIR="$2" | ||
|
||
. $(dirname $0)/test-lib.sh | ||
|
||
set -eu | ||
tmpd=$(mktemp -d) | ||
trap 'rm -rf -- "$tmpd"' EXIT | ||
|
||
${BINDIR}/mkcomposefs --from-file $ASSET_DIR/special.dump $tmpd/out.cfs | ||
${BINDIR}/composefs-info --filter=chardev --filter=inline --filter=whiteout dump $tmpd/out.cfs > $tmpd/dump.txt | ||
foundlines=$(wc -l < $tmpd/dump.txt) | ||
if test "${foundlines}" != "4"; then | ||
fatal "Filtered dump failed, expected 4 lines, found $foundlines" | ||
fi | ||
assert_file_has_content $tmpd/dump.txt '^/ 4096 40555.*trusted.foo1' | ||
assert_file_has_content $tmpd/dump.txt '^/chardev 0 20777' | ||
assert_file_has_content $tmpd/dump.txt '^/inline 15 100777.*FOOBAR' | ||
assert_file_has_content $tmpd/dump.txt '^/whiteout 0 20777' | ||
echo "ok" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters