zerotier-docker/Dockerfile

37 lines
1.1 KiB
Docker
Raw Normal View History

2021-08-25 16:41:57 +02:00
ARG ALPINE_IMAGE=alpine
ARG ALPINE_VERSION=3.14
2021-10-28 20:58:27 +02:00
ARG ZT_COMMIT=3c7bd65bc929a086f3fea04e7371c817bbf77a86
2021-09-22 22:02:50 +02:00
ARG ZT_VERSION=1.8.1
2021-08-19 11:06:14 +02:00
2021-08-25 16:41:57 +02:00
FROM ${ALPINE_IMAGE}:${ALPINE_VERSION} as builder
2021-08-25 16:21:13 +02:00
2021-08-25 16:41:57 +02:00
ARG ZT_COMMIT
2021-08-19 11:06:14 +02:00
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
2021-08-25 16:41:57 +02:00
FROM ${ALPINE_IMAGE}:${ALPINE_VERSION}
ARG ZT_VERSION
2021-08-31 08:47:48 +02:00
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"
2021-08-19 11:06:14 +02:00
COPY --from=builder /src/zerotier-one /usr/sbin/
2021-08-31 08:47:48 +02:00
RUN apk add --no-cache --purge --clean-protected --update libc6-compat libstdc++ \
&& mkdir -p /var/lib/zerotier-one \
2021-08-19 11:06:14 +02:00
&& ln -s /usr/sbin/zerotier-one /usr/sbin/zerotier-idtool \
2021-08-31 08:47:48 +02:00
&& ln -s /usr/sbin/zerotier-one /usr/sbin/zerotier-cli \
&& rm -rf /var/cache/apk/*
EXPOSE 9993/udp
2021-08-19 11:06:14 +02:00
ENTRYPOINT ["zerotier-one"]