move stuff to alpine to reduce image size (sdrplay not woking yet)

This commit is contained in:
Jakob Ketterl 2019-01-22 14:52:53 +00:00
parent dea09d8eaa
commit 8d10fc573f
7 changed files with 79 additions and 23 deletions

View File

@ -8,14 +8,14 @@ case $ARCH in
BASE_IMAGE=debian:stretch BASE_IMAGE=debian:stretch
;; ;;
armv*) armv*)
BASE_IMAGE=raspbian/stretch BASE_IMAGE=arm32v6/alpine
esac esac
TAGS=$ARCH TAGS=$ARCH
docker build --build-arg BASE_IMAGE=$BASE_IMAGE -t openwebrx-base:$ARCH -f docker/Dockerfiles/Dockerfile-base . docker build --build-arg BASE_IMAGE=$BASE_IMAGE -t openwebrx-base:$ARCH -f docker/Dockerfiles/Dockerfile-base .
docker build -t jketterl/openwebrx-rtlsdr:$ARCH -t jketterl/openwebrx:$ARCH -f docker/Dockerfiles/Dockerfile-rtlsdr . docker build --build-arg ARCH=$ARCH -t jketterl/openwebrx-rtlsdr:$ARCH -t jketterl/openwebrx:$ARCH -f docker/Dockerfiles/Dockerfile-rtlsdr .
docker build -t jketterl/openwebrx-sdrplay:$ARCH -f docker/Dockerfiles/Dockerfile-sdrplay . docker build --build-arg ARCH=$ARCH -t jketterl/openwebrx-sdrplay:$ARCH -f docker/Dockerfiles/Dockerfile-sdrplay .
if [ "$ARCH" == "armv7l" ]; then if [ "$ARCH" == "armv7l" ]; then
for image in openwebrx openwebrx-rtlsdr openwebrx-sdrplay; do for image in openwebrx openwebrx-rtlsdr openwebrx-sdrplay; do

View File

@ -1,6 +1,8 @@
ARG BASE_IMAGE ARG BASE_IMAGE
FROM $BASE_IMAGE FROM $BASE_IMAGE
RUN apk add --no-cache bash
ADD docker/scripts/install-dependencies.sh / ADD docker/scripts/install-dependencies.sh /
RUN /install-dependencies.sh RUN /install-dependencies.sh

View File

@ -1,4 +1,5 @@
FROM openwebrx-base ARG ARCH
FROM openwebrx-base:$ARCH
ADD docker/scripts/install-dependencies-rtlsdr.sh / ADD docker/scripts/install-dependencies-rtlsdr.sh /
RUN /install-dependencies-rtlsdr.sh RUN /install-dependencies-rtlsdr.sh

View File

@ -1,4 +1,5 @@
FROM openwebrx-base ARG ARCH
FROM openwebrx-base:$ARCH
ADD docker/scripts/install-dependencies-sdrplay.sh / ADD docker/scripts/install-dependencies-sdrplay.sh /
RUN /install-dependencies-sdrplay.sh RUN /install-dependencies-sdrplay.sh

View File

@ -1,9 +1,26 @@
#!/bin/bash #!/bin/bash
set -euxo pipefail set -euxo pipefail
apt-get update function cmakebuild() {
apt-get -y install --no-install-recommends rtl-sdr cd $1
mkdir build
cd build
cmake ..
make
make install
cd ../..
rm -rf $1
}
apt-get autoremove --purge -y cd /tmp
rm -rf /var/lib/apt/lists/*
STATIC_PACKAGES="libusb"
BUILD_PACKAGES="git libusb-dev cmake make gcc musl-dev g++ linux-headers"
apk add --no-cache $STATIC_PACKAGES
apk add --no-cache --virtual .build-deps $BUILD_PACKAGES
git clone https://github.com/osmocom/rtl-sdr.git
cmakebuild rtl-sdr
apk del .build-deps

View File

@ -14,11 +14,11 @@ function cmakebuild() {
cd /tmp cd /tmp
STATIC_PACKAGES="libusb-1.0.0-dev" STATIC_PACKAGES="libusb"
BUILD_PACKAGES="git build-essential cmake patch ca-certificates wget sudo udev" BUILD_PACKAGES="git cmake make patch wget sudo udev gcc g++ libusb-dev"
apt-get update apk add --no-cache $STATIC_PACKAGES
apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES apk add --no-cache --virtual .build-deps $BUILD_PACKAGES
case $(arch) in case $(arch) in
x86_64) x86_64)
@ -69,6 +69,4 @@ cmakebuild SoapySDRPlay
git clone https://github.com/rxseger/rx_tools git clone https://github.com/rxseger/rx_tools
cmakebuild rx_tools cmakebuild rx_tools
SUDO_FORCE_REMOVE=yes apt-get remove --purge --autoremove -y $BUILD_PACKAGES apk del .build-deps
rm -rf /var/lib/apt/lists/*

View File

@ -14,14 +14,53 @@ function cmakebuild() {
cd /tmp cd /tmp
STATIC_PACKAGES="sox libfftw3-dev python2.7 netcat libitpp-dev libsndfile1-dev" STATIC_PACKAGES="sox fftw python2 netcat-openbsd libsndfile lapack"
BUILD_PACKAGES="git build-essential cmake ca-certificates" BUILD_PACKAGES="git libsndfile-dev fftw-dev cmake ca-certificates make gcc musl-dev g++ lapack-dev linux-headers"
apt-get update apk add --no-cache $STATIC_PACKAGES
apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES apk add --no-cache --virtual .build-deps $BUILD_PACKAGES
git clone https://git.code.sf.net/p/itpp/git itpp
cmakebuild itpp
git clone https://github.com/simonyiszk/csdr.git git clone https://github.com/simonyiszk/csdr.git
cd csdr cd csdr
patch -Np1 <<'EOF'
--- a/csdr.c
+++ b/csdr.c
@@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/select.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
diff --git a/ddcd_old.h b/ddcd_old.h
index af4cfb5..b70092b 100644
--- a/ddcd_old.h
+++ b/ddcd_old.h
@@ -19,6 +19,7 @@
#include <stdarg.h>
#include <sys/stat.h>
#include <semaphore.h>
+#include <sys/select.h>
typedef struct client_s
{
diff --git a/nmux.h b/nmux.h
index 038bc51..079e416 100644
--- a/nmux.h
+++ b/nmux.h
@@ -11,6 +11,7 @@
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <sys/select.h>
#include "tsmpool.h"
#define MSG_START "nmux: "
EOF
make make
make install make install
cd .. cd ..
@ -36,6 +75,4 @@ cmakebuild digiham
git clone https://github.com/f4exb/dsd.git git clone https://github.com/f4exb/dsd.git
cmakebuild dsd cmakebuild dsd
apt-get remove --purge --autoremove -y $BUILD_PACKAGES apk del .build-deps
rm -rf /var/lib/apt/lists/*