-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-entrypoint.sh
41 lines (34 loc) · 992 Bytes
/
docker-entrypoint.sh
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
40
41
#!/usr/bin/env bash
. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"
# apk Packages
IFS=',' read -ra packages <<< "$APK_PACKAGES"
for package in "${packages[@]}"; do
echo "INFO: Startup // Installing apt package '${package}'."
apk add $package
done
# asdf Plugins
IFS=',' read -ra plugins <<< "$ASDF_PLUGINS"
for plugin in "${plugins[@]}"; do
plugin_name="${plugin%=*}"
plugin_version="${plugin#*=}"
echo "INFO: Startup // Installing asdf plugin '${plugin_name}' with version '${plugin_version}'."
asdf plugin add $plugin_name
asdf install $plugin_name $plugin_version
asdf global $plugin_name $plugin_version
done
case $1 in
sleep )
echo "INFO: Startup // Running sleeping loop"
trap "exit" SIGHUP
trap "exit" SIGINT
trap "exit" SIGTERM
while true; do
sleep 1
done
;;
* )
echo "INFO: Startup // Command Execution '${*}'"
exec "$@"
;;
esac