1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2025-12-24 12:28:43 +00:00
Files
operating-system/scripts/entry.sh
Pascal Vizeli e8d14bdc60 Support build as user (#405)
* Support build as user

* Update enter.sh

* Update Dockerfile

* Update enter.sh

* Update entry.sh
2019-05-14 01:16:40 +02:00

23 lines
421 B
Bash
Executable File

#!/bin/bash
set -e
USER="root"
# Run dockerd
dockerd -s vfs &> /dev/null &
# Setup local user
if [ "${BUILDER_UID:0}" -ne 0 ] && [ "${BUILDER_GID:0}" -ne 0 ]; then
groupadd -g "${BUILDER_GID}" builder
useradd -m -u "${BUILDER_UID}" -g "${BUILDER_GID}" -G docker builder
USER="builder"
fi
if CMD="$(command -v "$1")"; then
shift
sudo -H -u ${USER} "$CMD" "$@"
else
echo "Command not found: $1"
exit 1
fi