Repository for a base docker image for the Raspberry Pi with rtl-sdr support. Leveraging from the resin/rpi-raspbian base image, this image serves as the base for running containers of the various rtl-sdr programs such as rtl_tcp.
This image is intended to be used as a base image to build other containers from to run specific rtl-sdr programs. However, if one wishes to run this container directly, see the following examples.
Run rtl_tcp in a container, exposing connections to it via port 1234. Using --privileged and mapping the /dev/bus/usb volume, an RTL dongle is made available to the container, and clients will be able to connect via port 1234 to the docker hosts's address.
sudo docker run -d -it -p 1234:1234 --privileged -v /dev/bus/usb:/dev/bus/usb erben22/rpi-rtlsdr-base-image /usr/local/bin/rtl_tcp -a 172.17.0.1
- Based off the resin/rpi-raspbian base image.
- The rtl-sdr build dependencies are installed along with git.
- The rtl-sdr repository is cloned.
- rtl-sdr is compiled and installed to /usr/local/bin.
# Version: 0.0.1 # Initial base is from the resin rpi-raspbian image. FROM resin/rpi-raspbian MAINTAINER R. Cody Erben "firstname.lastname@example.org" ENV REFRESHED_AT 2016-02-05 ENV RTL_SDR_REPO /tmp/rtl-sdr # Enable the source repository for jessie: RUN echo 'deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi' >> /etc/apt/sources.list # Update the apt cache, install git, and # then pull the build dependencies for rtl-sdr. RUN apt-get update && apt-get -y upgrade RUN apt-get -y install git-core --no-install-recommends && apt-get clean RUN apt-get build-dep rtl-sdr --no-install-recommends && apt-get clean #libusb-1.0-0-dev pkg-config ca-certificates git-core cmake build-essential --no-install-recommends # Blacklist the rtl28xx driver so rtl-sdr is happy: RUN echo 'blacklist dvb_usb_rtl28xxu' > /etc/modprobe.d/raspi-blacklist.conf # Pull the rtl-sdr repo and build! RUN git clone git://git.osmocom.org/rtl-sdr.git $RTL_SDR_REPO RUN mkdir $RTL_SDR_REPO/build RUN cd $RTL_SDR_REPO/build && cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON RUN cd $RTL_SDR_REPO/build && make RUN cd $RTL_SDR_REPO/build && make install RUN ldconfig # Cleanup our image cause that is how we roll: RUN rm -rf $RTL_SDR_REPO RUN apt-get -y --purge autoremove git-core rtl-sdr perl cmake cpp dpkg-dev \ make libusb-* g++ RUN apt-get clean RUN rm -f /var/lib/apt/lists/* && \ rm -f /var/cache/apt/archives/*.deb && \ rm -f /var/cache/apt/archives/partial/*.deb && \ rm -f /var/cache/apt/*.bin
Why not? I had an interest in learning docker, and figured one area to jump in would be in some fiddly-diddlying I do with various Raspberry Pi's and running rtl-sdr programs. Collecting the setup into a container allows me to more easily deploy a new Pi to the mix, or to tinker with new distributions while more easily getting the rtl-sdr programs up and running.