still working
This commit is contained in:
26
abra-entrypoint.sh
Normal file
26
abra-entrypoint.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "++ running new entrypoint"
|
||||
ORIGINAL_ENTRYPOINT="$1"
|
||||
shift
|
||||
|
||||
echo "++ original entrypoint: ${ORIGINAL_ENTRYPOINT}"
|
||||
|
||||
# --- Load secrets into environment variables ---
|
||||
if [ -d /run/secrets ]; then
|
||||
for secret_file in /run/secrets/*; do
|
||||
echo "++ loading secret: ${secret_file}"
|
||||
var_name=$(basename "$secret_file" | tr '[:lower:]' '[:upper:]')
|
||||
export "$var_name"="$(cat "$secret_file")"
|
||||
done
|
||||
fi
|
||||
|
||||
echo "++ command: ${@}"
|
||||
|
||||
# --- Execute the original entrypoint and command ---
|
||||
if [ -n "$ORIGINAL_ENTRYPOINT" ] && [ "$ORIGINAL_ENTRYPOINT" != "null" ]; then
|
||||
exec "$ORIGINAL_ENTRYPOINT" "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
Reference in New Issue
Block a user