From 1956428abd5f6703a43b8c5a04fda04056881646 Mon Sep 17 00:00:00 2001 From: Lukas Prettenthaler Date: Wed, 1 Jan 2020 21:06:13 +0100 Subject: [PATCH] switch to alpine parent --- Dockerfile | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3983a8c..f582f08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,23 @@ -FROM debian:buster-slim +FROM alpine:3.11 as builder -# zerotier-one version ARG ZT_VERSION=1.4.6 -LABEL maintainer="Lukas Prettenthaler (zyclonite)" -LABEL version="$ZT_VERSION" -LABEL description="Containerized ZeroTier One for use on CoreOS or other Docker-only Linux hosts." +RUN apk add --update alpine-sdk linux-headers \ + && git clone --depth 1 --branch ${ZT_VERSION} https://github.com/zerotier/ZeroTierOne.git /src \ + && cd /src \ + && make -f make-linux.mk -# Configure environment -ENV ZT_VERSION=${ZT_VERSION} +FROM alpine:3.11 +LABEL version="1.4.6" +LABEL description="ZeroTier One Docker-only Linux hosts" -RUN apt-get update \ - && apt-get install -y gnupg2 \ - && apt-key adv --fetch-keys http://download.zerotier.com/contact%40zerotier.com.gpg \ - && echo "deb http://download.zerotier.com/debian/buster buster main" > /etc/apt/sources.list.d/zerotier.list \ - && apt-get update \ - && apt-get install -y zerotier-one=${ZT_VERSION} \ - && rm -rf /var/lib/apt/lists/* +RUN apk add --update libgcc libc6-compat libstdc++ -VOLUME /var/lib/zerotier-one -EXPOSE 9993 +EXPOSE 9993/udp + +COPY --from=builder /src/zerotier-one /usr/sbin/ +RUN mkdir -p /var/lib/zerotier-one \ + && ln -s /usr/sbin/zerotier-one /usr/sbin/zerotier-idtool \ + && ln -s /usr/sbin/zerotier-one /usr/sbin/zerotier-cli ENTRYPOINT ["zerotier-one"]