mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 21:17:52 +00:00
Initial docker release image tooling
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
This commit is contained in:
parent
e8390afad5
commit
ef784611b7
22
Dockerfile.release
Normal file
22
Dockerfile.release
Normal file
@ -0,0 +1,22 @@
|
||||
# vim: ft=dockerfile
|
||||
|
||||
FROM debian:buster as stage
|
||||
|
||||
ARG PACKAGE_BASEURL=https://download.zerotier.com/debian/buster/pool/main/z/zerotier-one/
|
||||
ARG ARCH=amd64
|
||||
ARG VERSION
|
||||
|
||||
RUN apt-get update -qq && apt-get install curl -y
|
||||
RUN curl -sSL -o zerotier-one.deb "${PACKAGE_BASEURL}/zerotier-one_${VERSION}_${ARCH}.deb"
|
||||
|
||||
FROM debian:buster
|
||||
|
||||
COPY --from=stage zerotier-one.deb .
|
||||
|
||||
RUN dpkg -i zerotier-one.deb && rm -f zerotier-one.deb
|
||||
RUN echo "${VERSION}" >/etc/zerotier-version
|
||||
|
||||
COPY entrypoint.sh.release /entrypoint.sh
|
||||
RUN chmod 755 /entrypoint.sh
|
||||
|
||||
CMD /entrypoint.sh
|
30
entrypoint.sh.release
Normal file
30
entrypoint.sh.release
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
grepzt() {
|
||||
(find /proc -name exe | xargs -I{} readlink {}) 2>/dev/null | grep -q zerotier-one
|
||||
return $?
|
||||
}
|
||||
|
||||
echo "starting zerotier"
|
||||
setsid /usr/sbin/zerotier-one &
|
||||
|
||||
while ! grepzt
|
||||
do
|
||||
echo "zerotier hasn't started, waiting a second"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "joining networks"
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
echo "joining $i"
|
||||
|
||||
while ! zerotier-cli join "$i"
|
||||
do
|
||||
echo "joining $i failed; trying again in 1s"
|
||||
sleep 1
|
||||
done
|
||||
done
|
||||
|
||||
sleep infinity
|
Loading…
Reference in New Issue
Block a user