mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-03-03 13:26:26 +00:00
build: install latest gosu from published image (#3717)
This commit is contained in:
@@ -48,7 +48,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then
|
||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||
fi
|
||||
|
||||
exec $(getSudoFromDistro) ${runAsUser}:${runAsGroup} "$(dirname "$0")/start-configuration" "$@"
|
||||
exec gosu ${runAsUser}:${runAsGroup} "$(dirname "$0")/start-configuration" "$@"
|
||||
else
|
||||
exec "$(dirname "$0")/start-configuration" "$@"
|
||||
fi
|
||||
|
||||
@@ -121,17 +121,6 @@ function log() {
|
||||
eval "$oldState"
|
||||
}
|
||||
|
||||
function getSudoFromDistro(){
|
||||
distro=$(getDistro)
|
||||
command=
|
||||
if [[ $distro == alpine ]]; then
|
||||
command="su-exec"
|
||||
else
|
||||
command="gosu"
|
||||
fi
|
||||
echo $command
|
||||
}
|
||||
|
||||
# Refer to https://unix.stackexchange.com/a/10065/102376
|
||||
function isTerminal() {
|
||||
if test -t 1; then
|
||||
|
||||
Reference in New Issue
Block a user