zerotier-docker/Dockerfile
Lukas Prettenthaler 1cefbf3f6d
version 1.8.5
2022-03-03 15:09:40 +01:00

39 lines
1.1 KiB
Docker

ARG ALPINE_IMAGE=alpine
ARG ALPINE_VERSION=edge
ARG ZT_COMMIT=f8e24f4629f0edde11c3e03c884c19a4fb69aaad
ARG ZT_VERSION=1.8.5
FROM ${ALPINE_IMAGE}:${ALPINE_VERSION} as builder
ARG ZT_COMMIT
RUN apk add --update alpine-sdk linux-headers \
&& git clone --quiet https://github.com/zerotier/ZeroTierOne.git /src \
&& git -C src reset --quiet --hard ${ZT_COMMIT} \
&& cd /src \
&& make -f make-linux.mk
FROM ${ALPINE_IMAGE}:${ALPINE_VERSION}
ARG ZT_VERSION
LABEL org.opencontainers.image.title="zerotier" \
org.opencontainers.image.version="${ZT_VERSION}" \
org.opencontainers.image.description="ZeroTier One as Docker Image" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/zyclonite/zerotier-docker"
COPY --from=builder /src/zerotier-one /usr/sbin/
RUN apk add --no-cache --purge --clean-protected libc6-compat libstdc++ \
&& 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 \
&& rm -rf /var/cache/apk/*
EXPOSE 9993/udp
ENTRYPOINT ["zerotier-one"]
CMD ["-U"]