mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-08-01 06:58:56 +00:00
Merge pull request #683 from nathanleclaire/make_vhd_build_more_bearable
Add support for building smaller Azure VHD for development
This commit is contained in:
commit
2be2b4b08f
@ -96,6 +96,7 @@ ami-clean-mount:
|
||||
uploadvhd: azure
|
||||
docker run \
|
||||
-i \
|
||||
-e VHD_SIZE \
|
||||
-e AZURE_STG_ACCOUNT_KEY \
|
||||
-e AZURE_STG_ACCOUNT_NAME \
|
||||
-e CONTAINER_NAME \
|
||||
|
@ -35,8 +35,10 @@ case "$1" in
|
||||
rm "${RAW_IMAGE}"
|
||||
fi
|
||||
|
||||
VHD_SIZE=${VHD_SIZE:-"30G"}
|
||||
|
||||
arrowecho "Writing empty image file"
|
||||
dd if=/dev/zero of="${RAW_IMAGE}" count=0 bs=1 seek=30G
|
||||
dd if=/dev/zero of="${RAW_IMAGE}" count=0 bs=1 seek="${VHD_SIZE}"
|
||||
|
||||
arrowecho "Formatting image file for boot"
|
||||
format_on_device "${RAW_IMAGE}"
|
||||
@ -70,7 +72,7 @@ case "$1" in
|
||||
|
||||
AZURE_STG_ACCOUNT_NAME=${AZURE_STG_ACCOUNT_NAME:-"mobyvhd"}
|
||||
CONTAINER_NAME=${CONTAINER_NAME:-"vhd"}
|
||||
BLOBNAME=${BLOBNAME:-$(md5sum "/tmp/mobylinux.vhd" | awk '{ print $1; }')-mobylinux.vhd}
|
||||
BLOBNAME=${BLOBNAME:-$(head -c 200m "/tmp/mobylinux.vhd" | md5sum | awk '{ print $1; }')-mobylinux.vhd}
|
||||
BLOB_URL="https://${AZURE_STG_ACCOUNT_NAME}.blob.core.windows.net/${CONTAINER_NAME}/${BLOBNAME}"
|
||||
|
||||
arrowecho "Uploading VHD to ${BLOBURL}..."
|
||||
|
Loading…
Reference in New Issue
Block a user