-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
85 lines (76 loc) · 2.62 KB
/
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:rtlsdr as build
RUN set -x && \
##define required packages
KEPT_PACKAGES=() && \
TEMP_PACKAGES=() && \
# packages needed to build
TEMP_PACKAGES+=(build-essential) && \
TEMP_PACKAGES+=(pkg-config) && \
TEMP_PACKAGES+=(git) && \
#
# install packages
apt-get update && \
apt-get install -q -o Dpkg::Options::="--force-confnew" -y --no-install-recommends --no-install-suggests \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" \
&& \
#
# Install the SDRPlay driver
mkdir -p /etc/udev/rules.d/ && \
curl --location --output /tmp/install_sdrplay.sh https://raw.githubusercontent.com/sdr-enthusiasts/install-libsdrplay/main/install_sdrplay.sh && \
chmod +x /tmp/install_sdrplay.sh && \
/tmp/install_sdrplay.sh --no-soapy && \
# build the special dump1090:
mkdir build && \
cd build && \
git clone --depth 1 --single-branch https://github.com/SDRplay/dump1090 && \
cd dump1090 && \
make RTLSDR=no AIRCRAFT_HASH_BITS=14 -j "$(nproc)" && \
cp dump1090 /
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:wreadsb
ARG TARGETPLATFORM TARGETOS TARGETARCH
ENV S6_KILL_FINISH_MAXTIME=10000 \
UPDATE_PLUGINS=true \
SOAPYSDR=sdrplay
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY --from=build /dump1090 /usr/bin/dump1090
RUN set -x && \
#
echo "TARGETPLATFORM $TARGETPLATFORM" && \
echo "TARGETOS $TARGETOS" && \
echo "TARGETARCH $TARGETARCH" && \
#
# define required packages
KEPT_PACKAGES=() && \
TEMP_PACKAGES=() && \
KEPT_PACKAGES+=(nano) && \
TEMP_PACKAGES+=(git) && \
#
# install packages
apt-get update && \
apt-get install -q -o Dpkg::Options::="--force-confnew" -y --no-install-recommends --no-install-suggests \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" \
&& \
#
# Install the SDRPlay driver
mkdir -p /etc/udev/rules.d/ && \
curl --location --output /tmp/install_sdrplay.sh https://raw.githubusercontent.com/sdr-enthusiasts/docker-sdrplay-beast1090/main/install_sdrplay.sh && \
chmod +x /tmp/install_sdrplay.sh && \
/tmp/install_sdrplay.sh
#
COPY rootfs/ /
# Add Container Version
RUN set -x && \
pushd /tmp && \
branch="##BRANCH##" && \
{ [[ "${branch:0:1}" == "#" ]] && branch="main" || true; } && \
git clone --depth=1 -b "$branch" https://github.com/sdr-enthusiasts/docker-sdrplay-beast1090.git && \
cd docker-sdrplay-beast1090 && \
echo "$(TZ=UTC date +%Y%m%d-%H%M%S)_$(git rev-parse --short HEAD)_$(git branch --show-current)" > "/.CONTAINER_VERSION" && \
popd && \
# Clean-up.
apt-get remove -y ${TEMP_PACKAGES[@]} && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/* && \
rm -f /usr/local/bin/viewadsb && ln -s /usr/local/bin/readsb /usr/local/bin/viewadsb