fix and finally ran
This commit is contained in:
39
image/build-image.sh
Executable file
39
image/build-image.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
IMAGE_NAME="${IMAGE_NAME:=alpine-vm}"
|
||||
IMAGE_SIZE="${IMAGE_SIZE:-1G}"
|
||||
IMAGE_FORMAT="${IMAGE_FORMAT:=raw}"
|
||||
ALPINE_BRANCH="${ALPINE_BRANCH:=latest-stable}"
|
||||
KERNEL_FLAVOR="${KERNEL_FLAVOR:=virt}"
|
||||
IMAGE_FILE="vm.${IMAGE_FORMAT}"
|
||||
SCRIPT_DIR="$PWD"
|
||||
OVERLAY_DIR="${SCRIPT_DIR}/overlay"
|
||||
CONFIGURE_SH="${SCRIPT_DIR}/configure.sh"
|
||||
|
||||
TMP=$(mktemp)
|
||||
|
||||
cleanup() {
|
||||
rm $TMP
|
||||
}
|
||||
|
||||
trap cleanup INT TERM EXIT
|
||||
|
||||
# We use BIOS here to skip creating partitions
|
||||
|
||||
alpine-make-vm-image \
|
||||
--boot-mode "BIOS" \
|
||||
--branch "$ALPINE_BRANCH" \
|
||||
--image-format "$IMAGE_FORMAT" \
|
||||
--image-size "$IMAGE_SIZE" \
|
||||
--kernel-flavor "$KERNEL_FLAVOR" \
|
||||
--serial-console \
|
||||
--fs-skel-dir "$OVERLAY_DIR" \
|
||||
--fs-skel-chown root:root \
|
||||
--script-chroot \
|
||||
--packages "git curl docker cronie" \
|
||||
"$IMAGE_FILE" \
|
||||
"$CONFIGURE_SH" | tee $TMP
|
||||
|
||||
if grep -q "ERROR" $TMP; then
|
||||
echo "BUILD FAILED"
|
||||
exit 114514
|
||||
fi
|
||||
Reference in New Issue
Block a user