-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile.wreadsb
54 lines (52 loc) · 1.52 KB
/
Dockerfile.wreadsb
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
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:rtlsdr
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+=(pkg-config) && \
# prerequisites for readsb \
KEPT_PACKAGES+=(libncurses6) && \
TEMP_PACKAGES+=(libncurses-dev) && \
KEPT_PACKAGES+=(zlib1g) && \
TEMP_PACKAGES+=(zlib1g-dev) && \
TEMP_PACKAGES+=(libusb-1.0-0-dev) && \
TEMP_PACKAGES+=(libzstd-dev) && \
KEPT_PACKAGES+=(libzstd1) && \
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" \
&& \
# readsb: clone repo
git clone \
--branch "dev" \
--depth 1 \
--single-branch \
'https://github.com/wiedehopf/readsb.git' \
'/src/readsb' \
&& \
# readsb: build & install
pushd /src/readsb && \
make \
RTLSDR=yes \
AIRCRAFT_HASH_BITS=14 \
DISABLE_RTLSDR_ZEROCOPY_WORKAROUND=yes \
-j "$(nproc)" \
&& \
find "/src/readsb" -maxdepth 1 -executable -type f -exec cp -v {} /usr/local/bin/ \; && \
popd && \
ldconfig && \
# readsb: simple tests
readsb --version && \
viewadsb --version && \
# 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