-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
91 lines (76 loc) · 2.48 KB
/
Copy pathDockerfile
File metadata and controls
91 lines (76 loc) · 2.48 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
FROM golang:1 AS telegraf_builder
WORKDIR /src/telegraf
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -x && \
apt-get update && \
apt-get install --no-install-recommends -y \
git \
ca-certificates \
make \
gcc \
libc-dev \
&& \
git clone https://github.com/influxdata/telegraf.git /src/telegraf && \
BRANCH_TELEGRAF=$(git tag --sort="-creatordate" | head -1) && \
git checkout "tags/${BRANCH_TELEGRAF}" && \
make
FROM debian:stable-slim AS readsb_builder
WORKDIR /src/readsb
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -x && \
apt-get update && \
apt-get install --no-install-recommends -y \
ca-certificates \
gcc \
git \
libc-dev \
libncurses-dev \
make \
zlib1g-dev \
&& \
git clone https://github.com/wiedehopf/readsb.git /src/readsb && \
make OPTIMIZE="-O3"
FROM debian:stable-slim AS final
ENV ADSBPORT=30005 \
ADSBTYPE=beast_in \
INTERVAL=5 \
JSONPORT=30012 \
MLATPORT=30105 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2
COPY --from=telegraf_builder /src/telegraf/telegraf /usr/local/bin/telegraf
COPY --from=readsb_builder /src/readsb/readsb /usr/local/bin/readsb
COPY --from=readsb_builder /src/readsb/viewadsb /usr/local/bin/viewadsb
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -x && \
apt-get update && \
apt-get install --no-install-recommends -y \
bc \
ca-certificates \
curl \
file \
libncurses6 \
gnupg \
jq \
net-tools \
procps \
&& \
curl -s https://raw.githubusercontent.com/mikenye/deploy-s6-overlay/master/deploy-s6-overlay.sh | sh && \
apt-get remove -y \
file \
gnupg \
&& \
apt-get autoremove -y && \
apt-get clean -y && \
/usr/local/bin/telegraf --version >> /VERSIONS && \
# In the line below, the "timeout" and "|| true" are workarounds for weird readsb behaviour.
# readsb doesn't exit when running with "--version". I've let the author know and will remove
# this workaround when fixed.
echo "readsb $(timeout 3s /usr/local/bin/readsb --version 2>&1 | grep -i version)" >> /VERSIONS || true && \
echo "debian version $(cat /etc/debian_version)" >> /VERSIONS && \
date -I >> /BUILDDATE && \
rm -rf /var/lib/apt/lists/* /src && \
cat /VERSIONS
COPY /rootfs /
ENTRYPOINT [ "/init" ]
# Add healthcheck
HEALTHCHECK --start-period=300s --interval=300s CMD /healthcheck.sh