reduce continer size ans security attack surface
This commit is contained in:
@@ -10,17 +10,15 @@ echo "#"
|
||||
if [ "$user" = '0' ]; then
|
||||
mkdir -p /home/$SERVICE_NAME/log /home/$SERVICE_NAME/config
|
||||
|
||||
if id $SERVICE_NAME ; then
|
||||
echo "user still exists"
|
||||
else
|
||||
if ! id $SERVICE_NAME &> /dev/null; then
|
||||
addgroup --gid $GID $SERVICE_NAME 2> /dev/null
|
||||
adduser --ingroup $SERVICE_NAME --shell /bin/false --disabled-password --no-create-home --comment "" --uid $UID $SERVICE_NAME
|
||||
adduser -G $SERVICE_NAME -s /bin/false -D -H -g "" -u $UID $SERVICE_NAME
|
||||
fi
|
||||
chown -R $SERVICE_NAME:$SERVICE_NAME /home/$SERVICE_NAME || true
|
||||
echo "######################################################"
|
||||
echo "#"
|
||||
|
||||
exec gosu $SERVICE_NAME "$@"
|
||||
exec su-exec $SERVICE_NAME "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user