zs/.dockerfiles/entrypoint.sh

16 lines
350 B
Bash
Executable File

#!/bin/sh
if [ "$(id -u)" -eq 0 ]; then
[ -n "${PUID}" ] && usermod -u "${PUID}" nobody
[ -n "${PGID}" ] && groupmod -g "${PGID}" nobody
fi
printf "Configuring zs...\n"
if [ "$(id -u)" -eq 0 ]; then
printf "Switching UID=%s and GID=%s\n" "$(id -u nobody)" "$(id -g nobody)"
exec su-exec nobody:nobody "$@"
else
exec zs "$@"
fi