-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathblacklist.Dockerfile
65 lines (53 loc) · 1.86 KB
/
blacklist.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA update.sh from Dockerfile.template
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM gcc:14 AS compile-stage
ARG TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
RUN chmod +x /tini
RUN apt update ; \
apt install cvs -y
RUN adduser \
--system --disabled-login \
--uid 6969 --group \
--home /etc/opentracker \
farmhand
WORKDIR /usr/src
# Run libowfat compilation in separated layer to benefit from docker layer cache
RUN cvs -d :pserver:[email protected]:/cvs -z9 co libowfat ; \
git clone git://erdgeist.org/opentracker ; \
cd /usr/src/libowfat ; \
make
# http://erdgeist.org/arts/software/opentracker/#build-instructions
RUN cd /usr/src/opentracker ; \
# Build opentracker statically to use it in scratch image
LDFLAGS=-static make \
FEATURES+=-DWANT_FULLSCRAPE \
FEATURES+=-DWANT_FULLLOG_NETWORKS \
FEATURES+=-DWANT_LOG_NUMWANT \
FEATURES+=-DWANT_MODEST_FULLSCRAPES \
FEATURES+=-DWANT_SPOT_WOODPECKER \
FEATURES+=-DWANT_ACCESSLIST_BLACK \
;\
bash -c 'mkdir -pv /tmp/stage/{etc/opentracker,bin}' ; \
bash -c 'touch /tmp/stage/etc/opentracker/{white,black}list' ; \
cp -v opentracker.conf.sample /tmp/stage/etc/opentracker/opentracker.conf ; \
# Opentrack configuration file
sed -ri \
-e 's!(.*)(tracker.user)(.*)!\2 farmhand!g;' \
-e 's!(.*)(access.blacklist)(.*)!\2 /etc/opentracker/blacklist!g;' \
/tmp/stage/etc/opentracker/opentracker.conf ; \
install -m 755 opentracker.debug /tmp/stage/bin ; \
make DESTDIR=/tmp/stage BINDIR="/bin" install
FROM scratch
COPY --from=compile-stage /tini /
COPY --from=compile-stage /tmp/stage /
COPY --from=compile-stage /etc/passwd /etc/passwd
WORKDIR /etc/opentracker
USER 6969
EXPOSE 6969/udp
EXPOSE 6969/tcp
ENTRYPOINT ["/tini", "--", "/bin/opentracker"]
CMD ["-f", "/etc/opentracker/opentracker.conf"]