diff --git a/Dockerfile b/Dockerfile index 4d72965..b613c24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,13 @@ FROM ubuntu:16.04 MAINTAINER Michael Stucki + ENV \ +# ccache specifics + CCACHE_SIZE=50G \ + CCACHE_DIR=/srv/ccache \ + USE_CCACHE=1 \ + CCACHE_COMPRESS=1 \ # Extra include PATH, it may not include /usr/local/(s)bin on some systems PATH=$PATH:/usr/local/bin/ @@ -79,10 +85,6 @@ RUN chmod a+x /home/build/startup.sh # Fix ownership RUN chown -R build:build /home/build -# Set global variables -ADD android-env-vars.sh /etc/android-env-vars.sh -RUN echo "source /etc/android-env-vars.sh" >> /etc/bash.bashrc - VOLUME /home/build/android VOLUME /srv/ccache diff --git a/android-env-vars.sh b/android-env-vars.sh deleted file mode 100644 index 141f7d1..0000000 --- a/android-env-vars.sh +++ /dev/null @@ -1,3 +0,0 @@ -export USE_CCACHE=1 -export CCACHE_DIR=/srv/ccache -export CCACHE_COMPRESS=1 diff --git a/startup.sh b/startup.sh index be5f50a..701a16f 100644 --- a/startup.sh +++ b/startup.sh @@ -1,9 +1,9 @@ #!/bin/sh # Initialize ccache if needed -if [ ! -f /srv/ccache/ccache.conf ]; then +if [ ! -f ${CCACHE_DIR}/ccache.conf ]; then echo "Initializing ccache in /srv/ccache..." - CCACHE_DIR=/srv/ccache ccache -M 50G + ccache -M ${CCACHE_SIZE} fi export USER="build"