mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-24 15:16:40 +00:00
Multiple image fixes:
- Can now provide the following environment variables to populate secrets (nice for kubernetes, other situations) - ZEROTIER_API_SECRET: authtoken.secret - ZEROTIER_IDENTITY_PUBLIC: identity.public - ZEROTIER_IDENTITY_SECRET: identity.secret - Joining networks by providing them as a part of docker's "command" array should now work properly Signed-off-by: Erik Hollensbe <linux@hollensbe.org>
This commit is contained in:
parent
a7f652781f
commit
23f9baa9f2
@ -15,8 +15,10 @@ 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
|
||||||
RUN echo "${VERSION}" >/etc/zerotier-version
|
RUN echo "${VERSION}" >/etc/zerotier-version
|
||||||
|
RUN rm -rf /var/lib/zerotier-one
|
||||||
|
|
||||||
COPY entrypoint.sh.release /entrypoint.sh
|
COPY entrypoint.sh.release /entrypoint.sh
|
||||||
RUN chmod 755 /entrypoint.sh
|
RUN chmod 755 /entrypoint.sh
|
||||||
|
|
||||||
CMD /entrypoint.sh
|
CMD []
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
@ -5,6 +5,31 @@ grepzt() {
|
|||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mkztfile() {
|
||||||
|
file=$1
|
||||||
|
mode=$2
|
||||||
|
content=$3
|
||||||
|
|
||||||
|
mkdir -p /var/lib/zerotier-one
|
||||||
|
echo "$content" > "/var/lib/zerotier-one/$file"
|
||||||
|
chmod "$mode" "/var/lib/zerotier-one/$file"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "x$ZEROTIER_API_SECRET" != "x" ]
|
||||||
|
then
|
||||||
|
mkztfile authtoken.secret 0600 "$ZEROTIER_API_SECRET"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "x$ZEROTIER_IDENTITY_PUBLIC" != "x" ]
|
||||||
|
then
|
||||||
|
mkztfile identity.public 0644 "$ZEROTIER_IDENTITY_PUBLIC"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "x$ZEROTIER_IDENTITY_SECRET" != "x" ]
|
||||||
|
then
|
||||||
|
mkztfile identity.secret 0600 "$ZEROTIER_IDENTITY_SECRET"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "starting zerotier"
|
echo "starting zerotier"
|
||||||
setsid /usr/sbin/zerotier-one &
|
setsid /usr/sbin/zerotier-one &
|
||||||
|
|
||||||
@ -14,7 +39,7 @@ do
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "joining networks"
|
echo "joining networks: $@"
|
||||||
|
|
||||||
for i in "$@"
|
for i in "$@"
|
||||||
do
|
do
|
||||||
|
Loading…
Reference in New Issue
Block a user