2020-11-15 17:50:36 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
. /etc/environment
|
|
|
|
|
|
|
|
# support building with configurable UID/GID
|
|
|
|
if [ ! -z "${BUILD_UID:-}" ]
|
|
|
|
then
|
|
|
|
BUILD_GID="${BUILD_GID:-$BUILD_UID}"
|
2020-11-26 20:33:48 -05:00
|
|
|
groupadd -r -g "$BUILD_GID" ci
|
|
|
|
useradd -r -u "$BUILD_UID" -g "$BUILD_GID" -s /bin/bash -m -d /root ci
|
2020-11-23 00:00:29 -05:00
|
|
|
chown "$BUILD_UID":"$BUILD_GID" /root
|
2020-11-26 20:33:48 -05:00
|
|
|
#exec runuser -m ci -- "$@"
|
|
|
|
exec sudo -E -u ci -- "$@"
|
2020-11-15 17:50:36 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
# otherwise just run as root
|
|
|
|
|
|
|
|
# since we are running in a docker container, and outputting files in a volume, we want world everything
|
|
|
|
umask a=rwx
|
|
|
|
|
|
|
|
exec "$@"
|