Make the ARCH-supervisor-base image builder smaller by not keeping the downloads, sstate and build directories

We should revisit this if we want to later copy those folders into the host and use Circle's caching system with them, or if https://github.com/moby/moby/issues/32507 gets implemented in which case we can use a bind mounted folder instead.

Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
Pablo Carranza Velez 2017-07-19 12:50:27 -03:00
parent d9605c71dd
commit b328a1e916

View File

@ -43,3 +43,9 @@ sudo -H -u builder \
&& source oe-core/oe-init-build-env build bitbake \
&& DL_DIR=$SHARED_DOWNLOADS SSTATE_DIR=$SHARED_SSTATE MACHINE=$TARGET_MACHINE $BUILD_DIR/bitbake/bin/bitbake core-image-minimal > /dev/null"
tar xzf $BUILD_DIR/build/tmp-glibc/deploy/images/$TARGET_MACHINE/core-image-minimal-$TARGET_MACHINE.tar.gz -C $DEST_DIR
# Delete the sstate and downloads directory so that the resulting image isn't huge
# If https://github.com/moby/moby/issues/32507 gets implemented we can start using
# a bind mounted cached directory instead
rm -rf $SHARED_DOWNLOADS
rm -rf $SHARED_SSTATE
rm -rf $BUILD_DIR