diff --git a/Dockerfile b/Dockerfile index b613c24..3f4756c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,7 +88,7 @@ RUN chown -R build:build /home/build VOLUME /home/build/android VOLUME /srv/ccache -CMD /home/build/startup.sh - USER build WORKDIR /home/build/android + +CMD /home/build/startup.sh diff --git a/run.sh b/run.sh index 4d2904f..ec14b45 100755 --- a/run.sh +++ b/run.sh @@ -30,6 +30,9 @@ while [[ $# > 0 ]]; do done # Create shared folders +# Although Docker would create non-existing directories on the fly, +# we need to have them owned by the user (and not root), to be able +# to write in them, which is a necessity for startup.sh mkdir -p $SOURCE mkdir -p $CCACHE diff --git a/startup.sh b/startup.sh index 701a16f..59e2c4b 100644 --- a/startup.sh +++ b/startup.sh @@ -6,7 +6,9 @@ if [ ! -f ${CCACHE_DIR}/ccache.conf ]; then ccache -M ${CCACHE_SIZE} fi -export USER="build" +# in Docker, the USER variable is unset by default +# but some programs (like jack toolchain) rely on it +export USER="$(whoami)" # Launch screen session screen -s /bin/bash