-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.readsb-netonly
70 lines (68 loc) · 2.95 KB
/
Dockerfile.readsb-netonly
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
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:base
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,SC2086,DL4006,SC2039
RUN set -x && \
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
# packages needed to install
TEMP_PACKAGES+=(git) && \
# packages needed to build
TEMP_PACKAGES+=(build-essential) && \
TEMP_PACKAGES+=(cmake) && \
TEMP_PACKAGES+=(pkg-config) && \
# prerequisites for readsb-protobuf \
KEPT_PACKAGES+=(protobuf-c-compiler) && \
KEPT_PACKAGES+=(libprotobuf-c1) && \
TEMP_PACKAGES+=(libprotobuf-c-dev) && \
TEMP_PACKAGES+=(librrd-dev) && \
KEPT_PACKAGES+=(libncurses5) && \
TEMP_PACKAGES+=(libncurses5-dev) && \
TEMP_PACKAGES+=(binutils) && \
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" \
&& \
# readsb: get latest release tag without cloning repo
# kx1t edits -- get simply the latest committed version from the dev (=default) branch rather than the latest tag
# this is because Mictronic doesn't update their labels very often, and important bug fixes are needlessly delayed
# BRANCH_READSB=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' 'https://github.com/Mictronics/readsb-protobuf.git' | grep -v "\-dev" | cut -d '/' -f 3 | tail -1) && \
BRANCH_READSB="dev" && \
# readsb: clone repo
git clone \
--branch "$BRANCH_READSB" \
--depth 1 \
--single-branch \
'https://github.com/Mictronics/readsb-protobuf.git' \
/src/readsb-protobuf \
&& \
# readsb: build & install (note, -j seems to have issues, so not using...)
pushd /src/readsb-protobuf && \
make BLADERF=no RTLSDR=no PLUTOSDR=no HAVE_BIASTEE=no && \
find "/src/readsb-protobuf" -maxdepth 1 -executable -type f -exec cp -v {} /usr/local/bin/ \; && \
popd && \
ldconfig && \
# readsb: simple tests
readsb --version && \
viewadsb --version && \
readsbrrd --version && \
# readsb: copy webapp files to /usr/share/readsb/html
mkdir -p /usr/share/readsb/html && \
cp -Rv /src/readsb-protobuf/webapp/src/* /usr/share/readsb/html/ && \
mkdir -p /etc/lighttpd/conf-available/ && \
cp -v /src/readsb-protobuf/debian/lighttpd/* /etc/lighttpd/conf-available/ && \
# readsb: copy collectd files
mkdir -p /etc/collectd/collectd.conf.d && \
cp -v /src/readsb-protobuf/debian/collectd/readsb.collectd.conf /etc/collectd/collectd.conf.d/ && \
mkdir -p /usr/share/readsb/graphs && \
cp -v /src/readsb-protobuf/debian/graphs/*.sh /usr/share/readsb/graphs/ && \
chmod a+x /usr/share/readsb/graphs/*.sh && \
# readsb: local copy of installed readsb version’s protobuf proto file
mkdir -p /opt/readsb-protobuf && \
cp -v /src/readsb-protobuf/readsb.proto /opt/readsb-protobuf/readsb.proto && \
# Clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
rm -rf /src/* && \
bash /scripts/clean-build.sh