-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.soapyrtlsdr
64 lines (62 loc) · 2.21 KB
/
Dockerfile.soapyrtlsdr
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
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+=(cmake) && \
TEMP_PACKAGES+=(pkg-config) && \
# dependencies for SoapySDR
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" \
&& \
# SoapySDR: get latest tag
BRANCH_SOAPYSDR=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' 'https://github.com/pothosware/SoapySDR.git' | grep -v '\^' | cut -d '/' -f 3 | grep '^soapy-sdr-.*' | tail -1) && \
# SoapySDR: clone latest tag
git clone --depth 1 --branch "$BRANCH_SOAPYSDR" "https://github.com/pothosware/SoapySDR.git" "/src/SoapySDR" && \
# SoapySDR: prepare to build
mkdir -p /src/SoapySDR/build && \
pushd /src/SoapySDR/build && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-Wno-dev \
../ \
&& \
# SoapySDR: make & install
make -j "$(nproc)" && \
make install && \
ldconfig && \
popd && \
# SoapySDR: simple test
SoapySDRUtil --info && \
# SoapyRTLSDR: get latest tag
BRANCH_SOAPYRTLSDR=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' 'https://github.com/pothosware/SoapyRTLSDR.git' | grep -v '\^' | cut -d '/' -f 3 | grep '^soapy-rtl-.*' | tail -1) && \
# SoapyRTLSDR: clone latest tag
git clone --depth 1 --branch "$BRANCH_SOAPYRTLSDR" "https://github.com/pothosware/SoapyRTLSDR.git" "/src/SoapyRTLSDR" && \
# SoapyRTLSDR: prepare to build
mkdir -p /src/SoapyRTLSDR/build && \
pushd /src/SoapyRTLSDR/build && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-Wno-dev \
../ \
&& \
# SoapyRTLSDR: make & install
make -j "$(nproc)" && \
make install && \
ldconfig && \
popd && \
# SoapyRTLSDR: simple test
SoapySDRUtil --check=rtlsdr && \
# 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