docker-opentracker/Dockerfile
2024-10-30 23:27:59 +08:00

38 lines
1.2 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM alpine as builder
RUN apk add git cvs make gcc g++ musl-dev zlib-dev
# 下载依赖库 libowfat 和 opentracker设置 opentracker 特性不公开详细信息、允许通告ip、关闭fullscrape、允许代理ip
RUN set -ex; cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co libowfat; \
cd libowfat; \
make ${nproc}; \
cd ..;
RUN set -ex; git clone git://erdgeist.org/opentracker; \
cd opentracker; \
sed -i '/FEATURES+=-DWANT_RESTRICT_STATS$/s/^#/#/' Makefile; \
sed -i '/FEATURES+=-DWANT_IP_FROM_QUERY_STRING$/s/^#//' Makefile; \
sed -i '/^FEATURES+=-DWANT_FULLSCRAPE$/s/^//' Makefile; \
sed -i '/^FEATURES+=-DWANT_IP_FROM_PROXY$/s/^#//' Makefile; \
make -j ${nrpoc};
FROM alpine
LABEL maintainer="Yezzi Hsueh <xueye404@gmail.com>"
ENV XDG_CONFIG_HOME=/config
VOLUME ["$XDG_CONFIG_HOME"]
EXPOSE 6969/tcp
EXPOSE 6969/udp
COPY --from=builder opentracker/opentracker /bin/opentracker
COPY --from=builder opentracker/opentracker.conf.sample /etc/opentracker/opentracker.conf.sample
COPY entrypoint.sh /entrypoint.sh
RUN mkdir -p $XDG_CONFIG_HOME && chmod 755 /entrypoint.sh
ENTRYPOINT ["/bin/sh", "-c", "/entrypoint.sh"]