From 985e6975449a9983bbcdea6a036d32c4f091f642 Mon Sep 17 00:00:00 2001 From: Michael Stucki Date: Sat, 28 Jun 2014 16:19:18 +0200 Subject: [PATCH] Use ccache (really) --- Dockerfile | 6 +++++- android-env-vars.sh | 1 + run.sh | 7 ++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ea12d4b..17579e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get -qq update RUN apt-get install -y bsdmainutils curl file screen RUN apt-get install -y android-tools-adb android-tools-fastboot RUN apt-get install -y bison build-essential flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-7-jdk openjdk-7-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev -RUN apt-get install -y g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev +RUN apt-get install -y ccache g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev RUN apt-get install -y tig # Workaround for apt-get upgrade issue described here: https://github.com/dotcloud/docker/issues/1724 @@ -35,4 +35,8 @@ ADD android-env-vars.sh /etc/android-env-vars.sh RUN echo "source /etc/android-env-vars.sh" >> /etc/bash.bashrc WORKDIR /home/cmbuild/android + VOLUME /home/cmbuild/android +VOLUME /srv/ccache + +RUN CCACHE_DIR=/srv/ccache ccache -M 50G diff --git a/android-env-vars.sh b/android-env-vars.sh index 84d65d2..cf2b542 100644 --- a/android-env-vars.sh +++ b/android-env-vars.sh @@ -1,2 +1,3 @@ export PATH=/home/cmbuild/bin:$PATH export USE_CCACHE=1 +export CCACHE_DIR=/srv/ccache diff --git a/run.sh b/run.sh index 4338b00..5b7dbc5 100755 --- a/run.sh +++ b/run.sh @@ -3,13 +3,14 @@ cd $(dirname $0) SOURCE=$(pwd)/android +CCACHE=$(pwd)/ccache CONTAINER_HOME=/home/cmbuild CONTAINER=cyanogenmod REPOSITORY=stucki/cyanogenmod -# Create a shared folder which will be used as working directory if it -# does not already exist. +# Create shared folders mkdir -p $SOURCE +mkdir -p $CCACHE # Build image if needed IMAGE_EXISTS=$(docker images -q $REPOSITORY) @@ -28,7 +29,7 @@ if [[ $IS_RUNNING == "true" ]]; then elif [[ $IS_RUNNING == "false" ]]; then docker start -i $CONTAINER else - docker run -v $SOURCE:$CONTAINER_HOME/android -i -t --name $CONTAINER $REPOSITORY sh -c "screen -s /bin/bash" + docker run -v $SOURCE:$CONTAINER_HOME/android -v $CCACHE:/srv/ccache -i -t --name $CONTAINER $REPOSITORY sh -c "screen -s /bin/bash" fi exit $?