allow .dockcross to use sudo

so set-up sudo before .dockcross executes!
This commit is contained in:
Daniel Hwang 2020-05-25 20:55:47 -07:00
parent ba6b0624f8
commit b3e72f7bf4
No known key found for this signature in database
GPG Key ID: 678563C9BB0E60C0

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