diff --git a/scripts/build-run.sh b/scripts/build-run.sh index 9cbda2808a..c1cb25a6ff 100755 --- a/scripts/build-run.sh +++ b/scripts/build-run.sh @@ -8,9 +8,12 @@ DIR=/opt/monad-linux VOLUME=$(dirname $(pwd))/:$DIR # creates new user in container matching the local user so that -# artifacts will be owned by the local user (instead of root) +# artifacts will be owned by the local user; set IMPERSONATE to false +# to disable and run as root, defaults to true +if [[ ! $IMPERSONATE ]]; then IMPERSONATE=true; fi impersonate() { + if ! $IMPERSONATE; then return; fi echo \ groupadd -g $CGID $CGROUP '&&' \ useradd -u $CUID -g $CGID -d $DIR $CUSER '&&' \ diff --git a/scripts/build-tty.sh b/scripts/build-tty.sh index ad70fae863..d6dfcbea6d 100755 --- a/scripts/build-tty.sh +++ b/scripts/build-tty.sh @@ -1,4 +1,5 @@ #!/usr/bin/env sh # Runs with a pseudo tty so that interactive shells can be opened -DOCKERFLAGS="--interactive --tty" ./build-run.sh "$*" +export DOCKERFLAGS="--interactive --tty" +./build-run.sh "$*" diff --git a/scripts/build.sh b/scripts/build.sh index 225e5953f4..abf252cc22 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -echo "$*" # Runs by non-interactively, just attaches output -DOCKERFLAGS="--attach STDOUT --attach STDERR" ./build-run.sh "$*" +export DOCKERFLAGS="--attach STDOUT --attach STDERR" +./build-run.sh "$*"