25 lines
689 B
Bash
25 lines
689 B
Bash
#!/bin/bash
|
|
#set -x
|
|
# Make errors visible upon `docker logs -f steam` command
|
|
exec 2>&1
|
|
|
|
id user >/dev/null 2>&1
|
|
[ $? -eq 0 ] || useradd -s /bin/bash -d /home/user -u ${USER_ID:-1000} user
|
|
|
|
/usr/sbin/update-ccache-symlinks
|
|
echo 'export PATH="/usr/lib/ccache:$PATH"
|
|
LC_ALL=C.UTF-8
|
|
LANG=C.UTF-8
|
|
export LC_ALL LANG' | tee /home/user/.profile
|
|
|
|
[ -f /home/user/.gitconfig ] || gosu user sh -c 'git config --global user.name "user in docker"; git config --global user.email "user@docker"'
|
|
|
|
# Set unlimited number of files and size of the cache:
|
|
gosu user sh -c 'ccache -F 0; ccache -M 0'
|
|
|
|
echo 'WARNING: allowing a user escalate to root'
|
|
chmod +s /usr/sbin/gosu
|
|
|
|
cd /home/user
|
|
gosu user bash -l
|