diff --git a/Dockerfile b/Dockerfile index 800607b..ea4b2e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,8 +49,6 @@ WORKDIR /home/cmbuild/android VOLUME /home/cmbuild/android VOLUME /srv/ccache -RUN CCACHE_DIR=/srv/ccache ccache -M 50G - CMD /root/startup.sh # This does not work yet, see https://github.com/docker/docker/issues/9806 diff --git a/startup.sh b/startup.sh index b93f581..4f6d817 100644 --- a/startup.sh +++ b/startup.sh @@ -1,5 +1,10 @@ #!/bin/sh +# Initialize ccache if needed +if [ ! -f /srv/ccache/CACHEDIR.TAG ]; then + CCACHE_DIR=/srv/ccache ccache -M 50G +fi + # Fix console permissions as long as https://github.com/docker/docker/issues/9806 is not fixed usermod --groups tty --append cmbuild chgrp tty /dev/console