BililiveRecorder/docker-entrypoint.sh
某亚瑟 0a2a00ca9f
feat: Optimize the way to get 'gosu' files (#600)
* feat: Optimize the way to get 'gosu' files

* Update Dockerfile and docker-entrypoint.sh

* change gosu copy source

---------

Co-authored-by: genteure <genteure@gmail.com>
2024-07-07 15:04:22 +08:00

21 lines
475 B
Bash

#!/bin/bash
set -e
umask "$UMASK"
if [ "$(id -u)" != "0" ]; then
echo "Skipped changing user and group because current user is not root."
exec dotnet /app/BililiveRecorder.Cli.dll "$@"
fi
PUID=${PUID:-0}
PGID=${PGID:-0}
if [ "${PUID}" != "0" ] && [ "${PGID}" != "0" ]; then
chown -R "${PUID}":"${PGID}" /rec
exec /usr/local/bin/gosu "${PUID}":"${PGID}" dotnet /app/BililiveRecorder.Cli.dll "$@"
else
exec dotnet /app/BililiveRecorder.Cli.dll "$@"
fi