From 51bc22ca5668bcea710efdf15881351bdfc2cf7a Mon Sep 17 00:00:00 2001 From: Nicola Corna Date: Mon, 6 Nov 2017 16:31:11 +0100 Subject: [PATCH] Make the ccache size configurable --- Dockerfile | 5 +++++ src/init.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dfa26a3..147866b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,11 @@ ENV USER root # WARNING: disabling this may slow down a lot your builds! ENV USE_CCACHE 1 +# ccache maximum size. It should be a number followed by an optional suffix: k, +# M, G, T (decimal), Ki, Mi, Gi or Ti (binary). The default suffix is G. Use 0 +# for no limit. +ENV CCACHE_SIZE 50G + # Environment for the LineageOS Branch name # See https://github.com/LineageOS/android_vendor_cm/branches for possible options ENV BRANCH_NAME 'cm-14.1' diff --git a/src/init.sh b/src/init.sh index 924d4ea..a203c3f 100755 --- a/src/init.sh +++ b/src/init.sh @@ -25,7 +25,7 @@ find /root/userscripts ! -type d -perm /g=w,o=w -exec echo ">> [$(date)] {} is w # Initialize CCache if it will be used if [ "$USE_CCACHE" = 1 ]; then - ccache -M 100G 2>&1 + ccache -M $CCACHE_SIZE 2>&1 fi # Initialize Git user information