fix: docker entrypoint.sh

This commit is contained in:
Jun Kurihara 2023-08-23 17:04:56 +09:00
commit 119637f24c
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23

View file

@ -58,8 +58,9 @@ EOF
####################################### #######################################
function setup_ubuntu () { function setup_ubuntu () {
id ${USER} > /dev/null
# Check the existence of the user, if not exist, create it. # Check the existence of the user, if not exist, create it.
if [ ! $(id ${USER}) ]; then if [ $? -eq 1 ]; then
echo "rpxy: Create user ${USER} with ${USER_ID}:${GROUP_ID}" echo "rpxy: Create user ${USER} with ${USER_ID}:${GROUP_ID}"
groupadd -g ${GROUP_ID} ${USER} groupadd -g ${GROUP_ID} ${USER}
useradd -u ${USER_ID} -g ${GROUP_ID} ${USER} useradd -u ${USER_ID} -g ${GROUP_ID} ${USER}
@ -81,8 +82,9 @@ function setup_ubuntu () {
####################################### #######################################
function setup_alpine () { function setup_alpine () {
id ${USER} > /dev/null
# Check the existence of the user, if not exist, create it. # Check the existence of the user, if not exist, create it.
if [ ! $(id ${USER}) ]; then if [ $? -eq 1 ]; then
echo "rpxy: Create user ${USER} with ${USER_ID}:${GROUP_ID}" echo "rpxy: Create user ${USER} with ${USER_ID}:${GROUP_ID}"
addgroup -g ${GROUP_ID} ${USER} addgroup -g ${GROUP_ID} ${USER}
adduser -H -D -u ${USER_ID} -G ${USER} ${USER} adduser -H -D -u ${USER_ID} -G ${USER} ${USER}