From 70188b31054e2bad73b9fee5251d68009bfcb22c Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Wed, 26 Oct 2011 21:59:20 -0700 Subject: [PATCH] add image caching to lxc --- tools/build_lxc.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/build_lxc.sh b/tools/build_lxc.sh index b629183b14..786d8398c6 100755 --- a/tools/build_lxc.sh +++ b/tools/build_lxc.sh @@ -152,6 +152,15 @@ if [ "$USE_CURRENT_DEVSTACK" = "1" ]; then cp -pr $CWD $CACHEDIR/$DEST/devstack fi +# pre-cache uec images +for image_url in ${IMAGE_URLS//,/ }; do + IMAGE_FNAME=`basename "$image_url"` + if [ ! -f $CACHEDIR/$IMAGE_FNAME ]; then + wget -c $image_url -O $CACHEDIR/$IMAGE_FNAME + fi + cp $CACHEDIR/$IMAGE_FNAME $CACHEDIR/$DEST/devstack/files +done + # Destroy the old container lxc-destroy -n $GUEST_NAME