Container image

pull/100/head
Steven Honson 2021-12-18 23:41:21 +11:00
rodzic 2dce774570
commit ad3dfe5bde
3 zmienionych plików z 112 dodań i 6 usunięć

46
.github/workflows/container.yml vendored 100644
Wyświetl plik

@ -0,0 +1,46 @@
name: Container Images
on:
push:
branches:
- 'master'
tags:
- '*'
pull_request:
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Calculate Container Metadata
id: meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/${{ github.repository }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Setup Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Images
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64, linux/386, linux/arm64, linux/arm/v6, linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

51
Dockerfile 100644
Wyświetl plik

@ -0,0 +1,51 @@
# -------------------
# The build container
# -------------------
FROM debian:bullseye-slim AS build
RUN apt-get update && \
apt-get -y --no-install-recommends install \
build-essential \
clang \
cmake \
libcurl4-openssl-dev \
libfftw3-dev \
libusb-1.0-0-dev \
pkg-config \
unzip && \
rm -rf /var/lib/apt/lists/*
ADD https://github.com/steve-m/librtlsdr/archive/master.zip /root/librtlsdr-master.zip
RUN unzip /root/librtlsdr-master.zip -d /root && \
rm /root/librtlsdr-master.zip && \
cd /root/librtlsdr-master && \
mkdir -p /root/librtlsdr-master/build && \
cd /root/librtlsdr-master/build && \
cmake -Wno-dev ../ && \
make && \
make install && \
rm -rf /root/librtlsdr-master
COPY . /root/rtlsdr-wsprd
RUN cd /root/rtlsdr-wsprd && \
make && \
make install
# -------------------------
# The application container
# -------------------------
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get -y --no-install-recommends install \
libcurl4 \
libfftw3-single3 \
usbutils && \
rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local/lib/librtlsdr.so.0 /usr/local/lib/librtlsdr.so.0
COPY --from=build /usr/local/bin/rtlsdr_wsprd /usr/local/bin/rtlsdr_wsprd
RUN ldconfig
ENTRYPOINT ["/usr/local/bin/rtlsdr_wsprd"]

Wyświetl plik

@ -97,6 +97,15 @@ This application written in C does:
rtlsdr_wsprd -f 2m -c A1XYZ -l AB12cd -g 29
```
## Container Image
As an alterative to the above steps, a pre-built container image containing rtlsdr-wsprd is available for use with [Docker](https://www.docker.com/) or [Podman](https://podman.io/).
Start the container with the right parameters/options for you (frequency, callsign, locator etc... Fake example below):
```bash
docker run --rm -it --device=/dev/bus/usb ghcr.io/Guenael/rtlsdr-wsprd:latest -f 2m -c A1XYZ -l AB12cd -g 29
```
## Tips (for your Raspberry Pi and SDR dongles)
- Use ferrite bead on the USB cable to limit the QRN