Skip to content

Commit

Permalink
Merge pull request #630 from sxa/purge_cache
Browse files Browse the repository at this point in the history
Prune build cache after creating images
  • Loading branch information
sxa authored Apr 27, 2023
2 parents cf9a794 + 0fd4216 commit e499808
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,4 @@ remove_summary_table_file
# Cleanup any old containers and images
cleanup_images
cleanup_manifest
clear_build_cache
13 changes: 13 additions & 0 deletions common_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,19 @@ function cleanup_manifest() {
rm -rf ~/.docker/manifests
}

function clear_build_cache() {
# Reduce the size of the build cache to avoid exhaustion of the space
docker system df
echo Pruning builder cache to 10Gb
# docker on our arm32 machines gives parse error if bigger than this
if [ "$(uname -m)" = "armv7l" ]; then
SPACE_TO_KEEP=2100000000
else
SPACE_TO_KEEP=10000000000
fi
docker builder prune -f --keep-storage ${SPACE_TO_KEEP}
}

# Check if a given docker image exists on the server.
# This script errors out if the image does not exist.
function check_image() {
Expand Down

0 comments on commit e499808

Please sign in to comment.