Merge pull request #416 from gnawhleinad/allow-sudo

allow .dockcross to use sudo
This commit is contained in:
Matt McCormick 2020-05-26 08:06:35 -04:00 committed by GitHub
commit 99cf8c38f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,15 +36,15 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
/dockcross/pre_exec.sh
fi
# Enable passwordless sudo capabilities for the user
chown root:$BUILDER_GID $(which gosu)
chmod +s $(which gosu); sync
# Execute project specific pre execution hook
if [[ -e /work/.dockcross ]]; then
gosu $BUILDER_UID:$BUILDER_GID /work/.dockcross
fi
# Enable passwordless sudo capabilities for the user
chown root:$BUILDER_GID $(which gosu)
chmod +s $(which gosu); sync
# Run the command as the specified user/group.
exec gosu $BUILDER_UID:$BUILDER_GID "$@"
else