├── Dockerfile ├── Makefile ├── README.md ├── docker-compose.yml └── entrypoint.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:bionic 2 | 3 | ARG TARGETPLATFORM 4 | ENV TARGETPLATFORM "$TARGETPLATFORM" 5 | 6 | RUN apt-get update 7 | RUN apt-get install -y rtl-sdr librtlsdr-dev wget 8 | 9 | RUN set -ex; \ 10 | if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ 11 | wget https://airspy.com/downloads/spyserver-linux-x64.tgz;\ 12 | tar xvzf spyserver-linux-x64.tgz;\ 13 | rm spyserver-linux-x64.tgz;\ 14 | elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ 15 | wget https://airspy.com/downloads/spyserver-arm32.tgz;\ 16 | tar xvzf spyserver-arm32.tgz;\ 17 | rm spyserver-arm32.tgz;\ 18 | fi; 19 | 20 | RUN mv spyserver spyserver_ping /usr/bin && \ 21 | mkdir -p /etc/spyserver && \ 22 | mv spyserver.config /etc/spyserver 23 | 24 | COPY entrypoint.sh . 25 | ENTRYPOINT ["./entrypoint.sh"] 26 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | docker build -t spyserver -f Dockerfile --build-arg TARGETPLATFORM=linux/amd64 . 3 | 4 | run: 5 | docker run -it --rm \ 6 | -e LIST_IN_DIRECTORY=0 \ 7 | spyserver 8 | 9 | buildx: 10 | docker buildx build --platform linux/arm/v7,linux/amd64 -t lloydpick/spyserver --push . 11 | 12 | .PHONY: build 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker AirSpy SpyServer 2 | 3 | Docker container for [AirSpy SpyServer](https://airspy.com/download), with support for x86 and arm32. 4 | 5 | [![](https://images.microbadger.com/badges/version/lloydpick/spyserver.svg)](https://microbadger.com/images/lloydpick/spyserver "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/lloydpick/spyserver.svg)](https://microbadger.com/images/lloydpick/spyserver "Get your own image badge on microbadger.com") https://hub.docker.com/r/lloydpick/spyserver 6 | 7 | ## Summary 8 | 9 | The container provides you with the SpyServer application running on port 5555. It has been tested with an RTL-SDR R820T2 RTL2832U device on a Raspberry Pi 3 Model B+. There is a [docker-compose.yml](https://github.com/lloydpick/docker-spyserver/blob/master/docker-compose.yml) file should you want to see how to correctly mount the USB device. 10 | 11 | ### Example 12 | 13 | See [docker-compose.yml](https://github.com/lloydpick/docker-spyserver/blob/master/docker-compose.yml) 14 | 15 | ### Configuration 16 | 17 | All configuration for this Docker container is done via environmental variables with sane defaults. To change a setting, simply set the appropriate environment variable. 18 | 19 | | Environment Variable | Default Value | Notes | 20 | |:------------------------:|:-------------:|:------| 21 | |`BIND_PORT` |`5555` |Port to run SpyServer on| 22 | |`LIST_IN_DIRECTORY` |`1` |List Server in the [AirSpy Directory](https://airspy.com/directory/), `1` for yes, `0` for no| 23 | |`OWNER_NAME` | |Name in the directory| 24 | |`OWNER_EMAIL` | |Directory contact| 25 | |`ANTENNA_TYPE` | |Random Wire/Magnetic Loop/Mini-Whip/Inverted V/etc.| 26 | |`ANTENNA_LOCATION` | |Lat/Long, eg. `48.858332, 2.294560`| 27 | |`GENERAL_DESCRIPTION` | |Description for the directory| 28 | |`MAXIMUM_CLIENTS` |`1` |Maximum number of clients that can connect at a time| 29 | |`MAXIMUM_SESSION_DURATION`|`0` |Maximum session duration in minutes. `0` for no limit| 30 | |`AlLOW_CONTROL` |`1` |Allow clients to retune and change of gain of the device| 31 | |`DEVICE_TYPE` |`Auto` |Possible Values: `AirspyOne`, `AirspyHF+`, `RTL-SDR`, `Auto` (Scans for the first available device)| 32 | |`DEVICE_SERIAL` |`0` |Device Serial Number as 64bit hex eg. `0xDD52D95C904534AD`. A value of `0` will acquire the first available device.| 33 | |`FFT_FPS` |`15` |FFT Frames Per Second| 34 | |`FFT_BIN_BITS` |`16` |FFT Bins, Bins = 2^fft_bin_bits| 35 | |`INITIAL_FREQUENCY` |`7100000` |Initial Center Frequency| 36 | |`BUFFER_SIZE_MS` |`50` |Buffer Size (in milliseconds)| 37 | |`BUFFER_COUNT` |`10` |Buffer Count| 38 | 39 | ### Rebuilding 40 | 41 | If you wish to rebuild this image for yourself, you can use the [Dockerfile](https://github.com/lloydpick/docker-spyserver/blob/master/Dockerfile) provided. However, the image that exists on DockerHub was built using the Docker experimental `buildx` functionality to build the `arm32` version from a Mac. You can view the build command in the [Makefile](https://github.com/lloydpick/docker-spyserver/blob/master/Makefile). 42 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | services: 4 | spyserver: 5 | restart: unless-stopped 6 | privileged: true 7 | environment: 8 | - LIST_IN_DIRECTORY=0 9 | - DEVICE_TYPE=RTL-SDR 10 | - DEVICE_SERIAL=0x1 11 | - BIND_PORT=5555 12 | ports: 13 | - "5555:5555" 14 | image: lloydpick/spyserver:latest 15 | devices: 16 | - "/dev/bus/usb" 17 | cap_add: 18 | - SYS_NICE 19 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | CONFIG=/etc/spyserver/spyserver.config 5 | 6 | sed -i "s/bind_port.*/bind_port = ${BIND_PORT:=5555}/g" $CONFIG 7 | sed -i "s/list_in_directory.*/list_in_directory = ${LIST_IN_DIRECTORY:=1}/g" $CONFIG 8 | sed -i "s/owner_name.*/owner_name = ${OWNER_NAME:=}/g" $CONFIG 9 | sed -i "s/owner_email.*/owner_email = ${OWNER_EMAIL:=}/g" $CONFIG 10 | sed -i "s/antenna_type.*/antenna_type = ${ANTENNA_TYPE:=}/g" $CONFIG 11 | sed -i "s/antenna_location.*/antenna_location = ${ANTENNA_LOCATION:=}/g" $CONFIG 12 | sed -i "s/general_description.*/general_description = ${GENERAL_DESCRIPTION:=}/g" $CONFIG 13 | sed -i "s/maximum_clients.*/maximum_clients = ${MAXIMUM_CLIENTS:=1}/g" $CONFIG 14 | sed -i "s/#maximum_session_duration.*/maximum_session_duration = ${MAXIMUM_SESSION_DURATION:=0}/g" $CONFIG 15 | sed -i "s/allow_control.*/allow_control = ${AlLOW_CONTROL:=1}/g" $CONFIG 16 | sed -i "s/device_type.*/device_type = ${DEVICE_TYPE:=Auto}/g" $CONFIG 17 | sed -i "s/device_serial.*/device_serial = ${DEVICE_SERIAL:=0}/g" $CONFIG 18 | sed -i "s/fft_fps.*/fft_fps = ${FFT_FPS:=15}/g" $CONFIG 19 | sed -i "s/fft_bin_bits.*/fft_bin_bits = ${FFT_BIN_BITS:=16}/g" $CONFIG 20 | sed -i "s/initial_frequency.*/initial_frequency = ${INITIAL_FREQUENCY:=7100000}/g" $CONFIG 21 | sed -i "s/buffer_size_ms.*/buffer_size_ms = ${BUFFER_SIZE_MS:=50}/g" $CONFIG 22 | sed -i "s/buffer_count.*/buffer_count = ${BUFFER_COUNT:=10}/g" $CONFIG 23 | 24 | exec spyserver $CONFIG 25 | --------------------------------------------------------------------------------