mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Make impersonation switchable
Useful when debugging issues with root vs non-root
This commit is contained in:
@@ -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 '&&' \
|
||||
|
||||
@@ -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
@@ -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 "$*"
|
||||
|
||||
Reference in New Issue
Block a user