diff options
Diffstat (limited to 'classes/image-oci-umoci.inc')
-rw-r--r-- | classes/image-oci-umoci.inc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/classes/image-oci-umoci.inc b/classes/image-oci-umoci.inc index 38917d4f..58e46681 100644 --- a/classes/image-oci-umoci.inc +++ b/classes/image-oci-umoci.inc | |||
@@ -106,14 +106,25 @@ IMAGE_CMD:oci() { | |||
106 | umoci config --image $image_name:${OCI_IMAGE_TAG} --author ${OCI_IMAGE_AUTHOR_EMAIL} | 106 | umoci config --image $image_name:${OCI_IMAGE_TAG} --author ${OCI_IMAGE_AUTHOR_EMAIL} |
107 | 107 | ||
108 | # make a tar version of the image direcotry | 108 | # make a tar version of the image direcotry |
109 | # 1) image_name.tar: compatible with oci tar format, blobs and rootfs | ||
110 | # are at the top level. Can load directly from something like podman | ||
111 | # 2) image_name-dir.tar: original format from meta-virt, is just a tar'd | ||
112 | # up oci image directory (compatible with skopeo :dir format) | ||
109 | if [ -n "${OCI_IMAGE_TAR_OUTPUT}" ]; then | 113 | if [ -n "${OCI_IMAGE_TAR_OUTPUT}" ]; then |
110 | tar -cf "$image_name.tar" "$image_name" | 114 | ( |
115 | cd "$image_name" | ||
116 | tar -cf ../"$image_name.tar" "." | ||
117 | ) | ||
118 | tar -cf "$image_name-dir.tar" "$image_name" | ||
119 | |||
111 | # create a convenience symlink | 120 | # create a convenience symlink |
112 | ln -sf "$image_name.tar" "${IMAGE_BASENAME}-${OCI_IMAGE_TAG}-oci.tar" | 121 | ln -sf "$image_name.tar" "${IMAGE_BASENAME}-${OCI_IMAGE_TAG}-oci.tar" |
122 | ln -sf "$image_name-dir.tar" "${IMAGE_BASENAME}-${OCI_IMAGE_TAG}-oci-dir.tar" | ||
113 | fi | 123 | fi |
114 | 124 | ||
115 | # We could make this optional, since the bundle is directly runnable via runc | 125 | # We could make this optional, since the bundle is directly runnable via runc |
116 | rm -rf $image_bundle_name | 126 | rm -rf $image_bundle_name |
117 | 127 | ||
128 | # This is the OCI image directory, which is technically the "image" as specified | ||
118 | ln -sf $image_name ${IMAGE_BASENAME}-${OCI_IMAGE_TAG}-oci | 129 | ln -sf $image_name ${IMAGE_BASENAME}-${OCI_IMAGE_TAG}-oci |
119 | } | 130 | } |