2021-08-25 16:41:57 +02:00
|
|
|
ARG ALPINE_IMAGE=alpine
|
2022-01-31 09:38:09 +01:00
|
|
|
ARG ALPINE_VERSION=edge
|
2022-07-01 00:15:27 +02:00
|
|
|
ARG ZT_COMMIT=651f45fe29155c462f4e56dd74f4a347f6861d0d
|
|
|
|
ARG ZT_VERSION=1.10.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
|
|
|
|
2022-05-24 11:03:18 +02:00
|
|
|
COPY patches /patches
|
2022-06-12 19:30:07 +02:00
|
|
|
COPY scripts /scripts
|
2022-05-24 11:03:18 +02:00
|
|
|
|
2022-03-03 15:23:09 +01:00
|
|
|
RUN apk add --update alpine-sdk linux-headers openssl-dev \
|
2021-08-19 11:06:14 +02:00
|
|
|
&& git clone --quiet https://github.com/zerotier/ZeroTierOne.git /src \
|
|
|
|
&& git -C src reset --quiet --hard ${ZT_COMMIT} \
|
|
|
|
&& cd /src \
|
2022-05-24 11:03:18 +02:00
|
|
|
&& git apply /patches/* \
|
2021-08-19 11:06:14 +02:00
|
|
|
&& 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
|
|
|
|
2022-06-12 19:30:07 +02:00
|
|
|
COPY --from=builder /src/zerotier-one /scripts/entrypoint.sh /usr/sbin/
|
2021-08-31 08:47:48 +02:00
|
|
|
|
2022-01-29 12:16:55 +01:00
|
|
|
RUN apk add --no-cache --purge --clean-protected libc6-compat libstdc++ \
|
2021-08-31 08:47:48 +02:00
|
|
|
&& 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
|
|
|
|
2022-06-12 17:53:02 +02:00
|
|
|
ENTRYPOINT ["entrypoint.sh"]
|
2021-10-31 12:24:24 +01:00
|
|
|
|
|
|
|
CMD ["-U"]
|