optimize dockerfile

This commit is contained in:
Lukas Prettenthaler 2021-08-31 08:47:48 +02:00 committed by GitHub
parent 040a5ce624
commit f86f73a9e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,16 +17,20 @@ FROM ${ALPINE_IMAGE}:${ALPINE_VERSION}
ARG ZT_VERSION
LABEL version="${ZT_VERSION}"
LABEL description="ZeroTier One as Docker Image"
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"
RUN apk add --update --no-cache libc6-compat libstdc++
COPY --from=builder /src/zerotier-one /usr/sbin/
RUN apk add --no-cache --purge --clean-protected --update 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
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"]