-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Julian Labatut <[email protected]>
- Loading branch information
Showing
5 changed files
with
212 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
# From https://github.com/virt-do/kaps/blob/main/hack/mkbundle.sh | ||
|
||
# The URL of a container image archive should be supplied in parameter | ||
# Example with alpine : https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-minirootfs-3.14.2-x86_64.tar.gz | ||
if [[ $# -ne 1 ]]; then | ||
echo "Missing container image URL" | ||
exit 1 | ||
fi | ||
|
||
DEST="ctr-bundle" | ||
IMAGE_ARCHIVE_URL=$1 | ||
IMAGE_ARCHIVE_NAME="imageArchive" | ||
|
||
rm -rf $DEST $IMAGE_ARCHIVE_NAME && mkdir -p "$DEST"/rootfs | ||
|
||
# Download and untar the image | ||
curl -sSL $IMAGE_ARCHIVE_URL -o $IMAGE_ARCHIVE_NAME | ||
tar xf $IMAGE_ARCHIVE_NAME -C "$DEST"/rootfs | ||
rm $IMAGE_ARCHIVE_NAME | ||
|
||
pushd "$DEST" > /dev/null | ||
# Generate a runtime spec | ||
runc spec --rootless | ||
popd > /dev/null |
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,34 @@ | ||
# From https://github.com/virt-do/lumper/blob/main/rootfs/mkrootfs.sh | ||
|
||
DEST="alpine-minirootfs" | ||
IMAGE_ARCHIVE_URL="https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-minirootfs-3.14.2-x86_64.tar.gz" | ||
IMAGE_ARCHIVE_NAME="imageArchive" | ||
|
||
rm -rf $DEST $IMAGE_ARCHIVE_NAME && mkdir $DEST | ||
|
||
# Download and untar the image | ||
curl -sSL $IMAGE_ARCHIVE_URL -o $IMAGE_ARCHIVE_NAME | ||
tar xf $IMAGE_ARCHIVE_NAME -C $DEST | ||
rm $IMAGE_ARCHIVE_NAME | ||
|
||
pushd "$DEST" > /dev/null | ||
# Create an init file in the rootfs | ||
cat > init <<EOF | ||
#! /bin/sh | ||
# | ||
# /init executable file in the initramfs | ||
# | ||
mount -t devtmpfs dev /dev | ||
mount -t proc proc /proc | ||
mount -t sysfs sysfs /sys | ||
ip link set up dev lo | ||
exec /opt/kaps run --bundle /ctr-bundle | ||
poweroff -f | ||
EOF | ||
|
||
chmod +x init | ||
|
||
popd > /dev/null | ||
|
||
# Here we do not create the rootfs image because we need to add some files in it later |
Oops, something went wrong.