From a712d5ca3e01d1e55a887751d52d5d8986406896 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 21 Jan 2019 17:44:35 +0000 Subject: [PATCH] split into separate docker builds --- build.sh | 1 + docker/scripts/install-dependencies-rtlsdr.sh | 9 ++- .../scripts/install-dependencies-sdrplay.sh | 63 +++++++++++++++++++ docker/scripts/install-dependencies.sh | 44 +------------ push.sh | 1 + 5 files changed, 75 insertions(+), 43 deletions(-) diff --git a/build.sh b/build.sh index fdfb3c7..caf047b 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euxo pipefail docker build -t openwebrx-base -f docker/Dockerfiles/Dockerfile-base . docker build -t jketterl/openwebrx-rtlsdr -t jketterl/openwebrx -f docker/Dockerfiles/Dockerfile-rtlsdr . docker build -t jketterl/openwebrs-sdrplay -f docker/Dockerfiles/Dockerfile-sdrplay . diff --git a/docker/scripts/install-dependencies-rtlsdr.sh b/docker/scripts/install-dependencies-rtlsdr.sh index 13f4793..1417bac 100755 --- a/docker/scripts/install-dependencies-rtlsdr.sh +++ b/docker/scripts/install-dependencies-rtlsdr.sh @@ -1,2 +1,9 @@ -#!/bin/sh +#!/bin/bash +set -euxo pipefail + +apt-get update +apt-get -y install --no-install-recommends rtl-sdr + +apt-get autoremove --purge -y +rm -rf /var/lib/apt/lists/* diff --git a/docker/scripts/install-dependencies-sdrplay.sh b/docker/scripts/install-dependencies-sdrplay.sh index 05a7907..9dbdac7 100755 --- a/docker/scripts/install-dependencies-sdrplay.sh +++ b/docker/scripts/install-dependencies-sdrplay.sh @@ -1,2 +1,65 @@ #!/bin/bash +set -euxo pipefail + +function cmakebuild() { + cd $1 + mkdir build + cd build + cmake .. + make + sudo make install + cd ../.. + rm -rf $1 +} + +cd /tmp + +STATIC_PACKAGES="libusb-1.0.0-dev" +BUILD_PACKAGES="git build-essential cmake patch" + +apt-get update +apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES + +wget http://www.sdrplay.com/software/SDRplay_RSP_API-RPi-2.13.1.run +sh SDRplay_RSP_API-RPi-2.13.1.run --noexec --target sdrplay +patch -Np0 <<'EOF' +--- sdrplay/install_lib.sh 2018-06-20 23:57:02.000000000 +0000 ++++ sdrplay/install_lib_patched.sh 2019-01-13 17:52:56.723838354 +0000 +@@ -2,18 +2,6 @@ + + echo "Installing SDRplay RSP API library 2.13..." + +-more sdrplay_license.txt +- +-while true; do +- echo "Press y and RETURN to accept the license agreement and continue with" +- read -p "the installation, or press n and RETURN to exit the installer [y/n] " yn +- case $yn in +- [Yy]* ) break;; +- [Nn]* ) exit;; +- * ) echo "Please answer y or n";; +- esac +-done +- + export ARCH=`arch` + export VERS="2.13" + +EOF +cd sdrplay +./install_lib.sh +cd .. +rm -rf sdrplay +rm SDRplay_RSP_API-RPi-2.13.1.run + +git clone https://github.com/pothosware/SoapySDR +cmakebuild SoapySDR + +git clone https://github.com/pothosware/SoapySDRPlay.git +cmakebuild SoapySDRPlay + +git clone https://github.com/rxseger/rx_tools +cmakebuild rx_tools + +apt-get remove --purge --autoremove -y $BUILD_PACKAGES +rm -rf /var/lib/apt/lists/* diff --git a/docker/scripts/install-dependencies.sh b/docker/scripts/install-dependencies.sh index 79db05d..7962ca2 100755 --- a/docker/scripts/install-dependencies.sh +++ b/docker/scripts/install-dependencies.sh @@ -14,52 +14,12 @@ function cmakebuild() { cd /tmp -STATIC_PACKAGES="sox libfftw3-dev python2.7 rtl-sdr netcat libitpp-dev libsndfile1-dev libusb-dev" -BUILD_PACKAGES="git build-essential cmake patch" +STATIC_PACKAGES="sox libfftw3-dev python2.7 netcat libitpp-dev libsndfile1-dev" +BUILD_PACKAGES="git build-essential cmake" apt-get update apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES -wget http://www.sdrplay.com/software/SDRplay_RSP_API-RPi-2.13.1.run -sh SDRplay_RSP_API-RPi-2.13.1.run --noexec --target sdrplay -patch -Np0 <<'EOF' ---- sdrplay/install_lib.sh 2018-06-20 23:57:02.000000000 +0000 -+++ sdrplay/install_lib_patched.sh 2019-01-13 17:52:56.723838354 +0000 -@@ -2,18 +2,6 @@ - - echo "Installing SDRplay RSP API library 2.13..." - --more sdrplay_license.txt -- --while true; do -- echo "Press y and RETURN to accept the license agreement and continue with" -- read -p "the installation, or press n and RETURN to exit the installer [y/n] " yn -- case $yn in -- [Yy]* ) break;; -- [Nn]* ) exit;; -- * ) echo "Please answer y or n";; -- esac --done -- - export ARCH=`arch` - export VERS="2.13" - -EOF -cd sdrplay -./install_lib.sh -cd .. -rm -rf sdrplay -rm SDRplay_RSP_API-RPi-2.13.1.run - -git clone https://github.com/pothosware/SoapySDR -cmakebuild SoapySDR - -git clone https://github.com/pothosware/SoapySDRPlay.git -cmakebuild SoapySDRPlay - -git clone https://github.com/rxseger/rx_tools -cmakebuild rx_tools - git clone https://github.com/simonyiszk/csdr.git cd csdr make diff --git a/push.sh b/push.sh index 6853b70..c39ff2e 100755 --- a/push.sh +++ b/push.sh @@ -1,2 +1,3 @@ #!/bin/bash +set -euxo pipefail docker push jketterl/openwebrx jketterl/openwebrx-rtlsdr jketterl/openwebrx-sdrplay