forked from bfg100k/zerotier-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (28 loc) · 1.26 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ARG ALPINE_IMAGE=alpine
ARG ALPINE_VERSION=latest
ARG ZT_COMMIT=91e7ce87f09ac1cfdeaf6ff22c3cedcd93574c86
ARG ZT_VERSION=1.14.0
FROM ${ALPINE_IMAGE}:${ALPINE_VERSION} as builder
ARG ZT_COMMIT
RUN apk add --update alpine-sdk linux-headers cargo openssl-dev \
&& 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-gateway" \
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/ddeitterick/zerotier-gateway"
COPY --from=builder /src/zerotier-one /usr/sbin/
RUN apk add --no-cache --purge --clean-protected --update libc6-compat libstdc++ bash iptables iptables-legacy iproute2\
&& 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
COPY main.sh /usr/sbin/main.sh
RUN chmod 0755 /usr/sbin/main.sh
ENTRYPOINT ["/usr/sbin/main.sh"]