Enhance Docker environment with missing SDR dependencies

Added build and runtime dependencies for AIS-catcher, readsb (SoapySDR enabled), direwolf, and hcxtools. Included rx_tools build from source. Updated dependency checker to potentialy verify SoapySDR modules.
This commit is contained in:
William Shields
2026-01-24 12:37:20 -08:00
parent 6a63c13cd8
commit 93111b93c5
3 changed files with 93 additions and 6 deletions

5
.gitignore vendored
View File

@@ -34,4 +34,7 @@ build/
uv.lock
*.db
*.sqlite3
intercept.db
intercept.db
# Agent Files
.agent

View File

@@ -31,6 +31,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# GPS support
gpsd-clients \
# Utilities
# APRS
direwolf \
# WiFi Extra
hcxdumptool \
hcxtools \
# SDR Hardware & SoapySDR
soapysdr-tools \
soapysdr-module-rtlsdr \
soapysdr-module-hackrf \
soapysdr-module-lms7 \
limesuite \
hackrf \
# Utilities
curl \
procps \
&& rm -rf /var/lib/apt/lists/*
@@ -43,6 +56,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
libncurses-dev \
libsndfile1-dev \
libsoapysdr-dev \
libhackrf-dev \
liblimesuite-dev \
libsqlite3-dev \
libcurl4-openssl-dev \
zlib1g-dev \
libzmq3-dev \
# Build dump1090
&& cd /tmp \
&& git clone --depth 1 https://github.com/flightaware/dump1090.git \
@@ -51,6 +71,34 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& cp dump1090 /usr/bin/dump1090-fa \
&& ln -s /usr/bin/dump1090-fa /usr/bin/dump1090 \
&& rm -rf /tmp/dump1090 \
# Build AIS-catcher
&& cd /tmp \
&& git clone https://github.com/jvde-github/AIS-catcher.git \
&& cd AIS-catcher \
&& mkdir build && cd build \
&& cmake .. \
&& make \
&& cp AIS-catcher /usr/bin/AIS-catcher \
&& cd /tmp \
&& rm -rf /tmp/AIS-catcher \
# Build readsb
&& cd /tmp \
&& git clone --depth 1 https://github.com/wiedehopf/readsb.git \
&& cd readsb \
&& make BLADERF=no PLUTOSDR=no SOAPYSDR=yes \
&& cp readsb /usr/bin/readsb \
&& cd /tmp \
&& rm -rf /tmp/readsb \
# Build rx_tools
&& cd /tmp \
&& git clone https://github.com/rxseger/rx_tools.git \
&& cd rx_tools \
&& mkdir build && cd build \
&& cmake .. \
&& make \
&& make install \
&& cd /tmp \
&& rm -rf /tmp/rx_tools \
# Build acarsdec
&& cd /tmp \
&& git clone --depth 1 https://github.com/TLeconte/acarsdec.git \
@@ -62,11 +110,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /tmp/acarsdec \
# Cleanup build tools to reduce image size
&& apt-get remove -y \
build-essential \
git \
pkg-config \
cmake \
libncurses-dev \
build-essential \
git \
pkg-config \
cmake \
libncurses-dev \
libsndfile1-dev \
libsoapysdr-dev \
libhackrf-dev \
liblimesuite-dev \
libsqlite3-dev \
libcurl4-openssl-dev \
zlib1g-dev \
libzmq3-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*

View File

@@ -3,6 +3,7 @@ from __future__ import annotations
import logging
import os
import shutil
import subprocess
from typing import Any
logger = logging.getLogger('intercept.dependencies')
@@ -32,6 +33,28 @@ def get_tool_path(name: str) -> str | None:
return None
def check_soapy_factory(factory_name: str) -> bool:
"""Check if a SoapySDR factory/module is available using SoapySDRUtil."""
try:
# Run SoapySDRUtil --info and look for the factory in 'Available factories'
result = subprocess.run(['SoapySDRUtil', '--info'], capture_output=True, text=True)
if result.returncode != 0:
return False
# Parse output for available factories
# Format usually: "Available factories... hackrf, lime, rtlsdr"
for line in result.stdout.splitlines():
if "Available factories" in line:
factories = line.split("...")[-1].strip().split(",")
factories = [f.strip() for f in factories]
if factory_name in factories:
return True
return False
except Exception as e:
logger.debug(f"Failed to check SoapySDR factory {factory_name}: {e}")
return False
# Comprehensive tool dependency definitions
TOOL_DEPENDENCIES = {
'pager': {
@@ -291,6 +314,7 @@ TOOL_DEPENDENCIES = {
'SoapyLMS7': {
'required': False,
'description': 'SoapySDR plugin for LimeSDR',
'soapy_factory': 'lime',
'install': {
'apt': 'sudo apt install soapysdr-module-lms7',
'brew': 'brew install soapylms7',
@@ -309,6 +333,7 @@ TOOL_DEPENDENCIES = {
'SoapyHackRF': {
'required': False,
'description': 'SoapySDR plugin for HackRF',
'soapy_factory': 'hackrf',
'install': {
'apt': 'sudo apt install soapysdr-module-hackrf',
'brew': 'brew install soapyhackrf',
@@ -400,6 +425,9 @@ def check_all_dependencies() -> dict[str, dict[str, Any]]:
except Exception as e:
logger.debug(f"Failed to import {tool}: {type(e).__name__}: {e}")
installed = False
# Check using SoapySDRUtil if specified
elif tool_config.get('soapy_factory'):
installed = check_soapy_factory(tool_config['soapy_factory'])
else:
# Check for alternatives
alternatives = tool_config.get('alternatives', [])