base_tools/entrypoint.sh

23 lines
529 B
Bash
Executable File

#!/bin/sh
set -eo pipefail
if [ "${ENTRYPOINT_SCRIPTS:-true}" != "false" ]; then
# Scriplets in /entrypoint.d will be sourced (if ending with .env) or executed
if [ -d "/entrypoint.d" ]; then
for H in $(find /entrypoint.d -type f -o -type l | sort); do
if [[ "$H" == "*.env" ]]; then
echo "Sourcing entrypoint snippet $H"
source "$H"
elif [ -x "$H" ]; then
echo "Running entrypoint script $H"
$H "$@"
else
echo "Skiping $H"
fi
done
fi
fi
exec "$@"