mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-04 08:21:03 +00:00
Fix dockerfile & entrypoint:
- Resolve issue with join not being checked properly for success without using external tools - Resolve issue where initial boot was not being checked properly - Now output errors when zerotier fails to start closes #1581 cc @altano for inspiration for this patch Signed-off-by: Erik Hollensbe <git@hollensbe.org>
This commit is contained in:
parent
2800534445
commit
f41372680d
@ -11,6 +11,8 @@ RUN curl -sSL -o zerotier-one.deb "${PACKAGE_BASEURL}/zerotier-one_${VERSION}_${
|
|||||||
|
|
||||||
FROM debian:buster
|
FROM debian:buster
|
||||||
|
|
||||||
|
RUN apt-get update -qq && apt-get install openssl libssl1.1 -y
|
||||||
|
|
||||||
COPY --from=stage zerotier-one.deb .
|
COPY --from=stage zerotier-one.deb .
|
||||||
|
|
||||||
RUN dpkg -i zerotier-one.deb && rm -f zerotier-one.deb
|
RUN dpkg -i zerotier-one.deb && rm -f zerotier-one.deb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
grepzt() {
|
grepzt() {
|
||||||
[ ! -n "$(cat /var/lib/zerotier-one/zerotier-one.pid)" -a -d "/proc/$(cat /var/lib/zerotier-one/zerotier-one.pid)" ]
|
[ -f /var/lib/zerotier-one/zerotier-one.pid -a -n "$(cat /var/lib/zerotier-one/zerotier-one.pid)" -a -d "/proc/$(cat /var/lib/zerotier-one/zerotier-one.pid)" ]
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,6 +46,7 @@ nohup /usr/sbin/zerotier-one &
|
|||||||
while ! grepzt
|
while ! grepzt
|
||||||
do
|
do
|
||||||
echo "zerotier hasn't started, waiting a second"
|
echo "zerotier hasn't started, waiting a second"
|
||||||
|
tail -n 10 nohup.out
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -55,9 +56,11 @@ for i in "$@"
|
|||||||
do
|
do
|
||||||
echo "joining $i"
|
echo "joining $i"
|
||||||
|
|
||||||
while ! zerotier-cli join "$i"
|
zerotier-cli join "$i"
|
||||||
|
|
||||||
|
while [ "$(zerotier-cli get $i status)" != "OK" ]
|
||||||
do
|
do
|
||||||
echo "joining $i failed; trying again in 1s"
|
echo "joining $i failed (are they added in central?); trying again in 1s"
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user