-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.sh
executable file
·29 lines (23 loc) · 827 Bytes
/
install.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
#!/bin/bash
set -xeo pipefail
apt-get update -qq
apt-get install -qqy --no-install-recommends wget procps ca-certificates jq
mkdir /ez /ez/bin /important /data
mv entrypoint.sh util.sh docker/networking.sh s6/default-finish.sh /ez/
mv docker/backup /ez/bin/
ln -s /data/config /important
install() {
local name=$1
(cd $name && ./install)
[ -f $name/fix-attrs ] && mv $name/fix-attrs /etc/fix-attrs.d/$name
[ -f $name/run ] && mv $name /etc/services.d/
true
}
install s6
for name in $(grep -E -o '[a-z0-9-]+' <<< $INSTALL); do
install $name
done
# make 'ez <cmd>' delegate to '<cmd>', in case users accidentally use it inside the container
echo -e '#!/bin/sh\nexec "$@"' > /ez/bin/ez && chmod +x /ez/bin/ez
apt-get autoremove --purge -y && apt-get clean
rm -rf /var/lib/apt/lists/* /var/cache/* /usr/share/doc