-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.wreadsb
70 lines (67 loc) · 2.1 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:mlatclient AS buildimage
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:soapyrtlsdr
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,SC2086,DL4006,SC2039
RUN \
--mount=type=bind,from=buildimage,source=/,target=/buildimage/ \
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) && \
# Needed to run the mlat_client:
KEPT_PACKAGES+=(python3-minimal) && \
KEPT_PACKAGES+=(python3-pkg-resources) && \
# 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)" \
&& \
cp readsb /usr/local/bin/ && \
popd && \
pushd /usr/local/bin && \
ln -s readsb viewadsb && \
popd && \
ldconfig && \
# readsb: simple tests
readsb --version && \
viewadsb --version && \
# Get mlat-client
tar zxf /buildimage/mlatclient.tgz -C / && \
ln -s /usr/local/bin/mlat-client /usr/bin/mlat-client && \
# Clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
# test mlat-client
/usr/bin/mlat-client --help > /dev/null && \
# remove pycache introduced by testing mlat-client
{ find /usr | grep -E "/__pycache__$" | xargs rm -rf || true; } && \
rm -rf /src/* && \
bash /scripts/clean-build.sh