forked from rockstorm101/git-server-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·39 lines (30 loc) · 861 Bytes
/
docker-entrypoint.sh
File metadata and controls
executable file
·39 lines (30 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
set -eu
if [ -n "${DEBUG-}" ]; then set -x; fi
script_name="$0"
msg() { echo >&2 -e "${script_name}:" "${1-}"; }
warn() { msg "warning: ${1-}"; }
die() { msg "error: ${1-}"; exit "${2-1}"; }
entrypoint_dir="/docker-entrypoint.d"
if [ -d "$entrypoint_dir" ]; then
msg "Starting container configuration"
else
die "Configuration directory '${entrypoint_dir}' not found" 64
fi
find "/docker-entrypoint.d/" -follow -type f -print | \
sort -V | \
while read -r f; do
case "$f" in
*.sh)
if [ -x "$f" ]; then
msg "Running $f"
"$f"
else
warn "Ignored '$f', not executable"
fi
;;
*) warn "Ignored '$f'" ;;
esac
done
msg "Container configuration completed"
exec "$@"