Make impersonation switchable

Useful when debugging issues with root vs non-root
This commit is contained in:
Andrew Schwartzmeyer
2015-10-01 10:18:10 -07:00
parent 3ea6e96663
commit be7932155a
3 changed files with 8 additions and 4 deletions
+4 -1
View File
@@ -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 '&&' \
+2 -1
View File
@@ -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 "$*"
+2 -2
View File
@@ -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 "$*"