From 919db8dcee4d3452a0dc6b2a43abfd3f662acaa9 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Tue, 30 May 2017 19:38:12 +0200 Subject: [PATCH] fix user permission specific problems and add comments --- Dockerfile | 4 ++-- run.sh | 3 +++ startup.sh | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) 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