diff --git a/docker/base/.dockerignore b/docker/base/.dockerignore new file mode 100644 index 000000000..9b5f85551 --- /dev/null +++ b/docker/base/.dockerignore @@ -0,0 +1,3 @@ +build.sh +gui/ +server/ \ No newline at end of file diff --git a/docker/Dockerfile b/docker/base/Dockerfile similarity index 83% rename from docker/Dockerfile rename to docker/base/Dockerfile index eddd675a0..6f47a635d 100644 --- a/docker/Dockerfile +++ b/docker/base/Dockerfile @@ -4,7 +4,10 @@ ENV DEBIAN_FRONTEND=noninteractive # Create a user with sudo rights RUN apt-get update && apt-get -y install sudo -RUN useradd -m sdr && echo "sdr:sdr" | chpasswd && adduser sdr sudo +RUN useradd -m sdr && echo "sdr:sdr" | chpasswd \ + && adduser sdr sudo \ + && usermod -a -G audio,dialout,plugdev sdr\ + && sudo usermod --shell /bin/bash sdr RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers USER sdr @@ -14,11 +17,8 @@ RUN sudo apt-get update && sudo apt-get -y install \ openssh-server \ iputils-ping \ traceroute \ - iproute2 - -# Configure SSH for X-forwarding -RUN sudo sed -i '/X11Forwarding/c\X11Forwarding yes' /etc/ssh/sshd_config \ - && sudo sed -i '/X11UseLocalhost/c\X11UseLocalhost no' /etc/ssh/sshd_config + iproute2 \ + nmap # Prepare buiid and install environment RUN sudo mkdir /opt/build /opt/install \ @@ -69,7 +69,8 @@ RUN sudo apt-get update && sudo apt-get -y install \ ffmpeg \ libavcodec-dev \ libavformat-dev \ - libopus-dev + libopus-dev \ + libavahi-client-dev # CM256cc RUN cd /opt/build \ @@ -215,7 +216,6 @@ RUN cd /opt/build \ && make -j4 install # Soapy remote -RUN sudo apt-get update && sudo apt-get -y install libavahi-client-dev RUN cd /opt/build \ && git clone https://github.com/pothosware/SoapyRemote.git \ && cd SoapyRemote \ @@ -223,16 +223,4 @@ RUN cd /opt/build \ && mkdir build; cd build \ && cmake -DCMAKE_INSTALL_PREFIX=/opt/install/SoapySDR -DSOAPY_SDR_INCLUDE_DIR=/opt/install/SoapySDR/include -DSOAPY_SDR_LIBRARY=/opt/install/SoapySDR/lib/libSoapySDR.so .. \ && make -j4 install - -# Finally SDRangel -RUN cd /opt/build \ - && git clone https://github.com/f4exb/sdrangel.git \ - && cd sdrangel \ - && mkdir build; cd build \ - && cmake -Wno-dev -DDEBUG_OUTPUT=ON -DBUILD_TYPE=RELEASE -DRX_SAMPLE_24BIT=ON -DMIRISDR_DIR=/opt/install/libmirisdr -DAIRSPY_DIR=/opt/install/libairspy -DAIRSPYHF_DIR=/opt/install/libairspyhf -DBLADERF_DIR=/opt/install/libbladeRF -DHACKRF_DIR=/opt/install/libhackrf -DRTLSDR_DIR=/opt/install/librtlsdr -DLIMESUITE_DIR=/opt/install/LimeSuite -DIIO_DIR=/opt/install/libiio -DCM256CC_DIR=/opt/install/cm256cc -DDSDCC_DIR=/opt/install/dsdcc -DSERIALDV_DIR=/opt/install/serialdv -DMBE_DIR=/opt/install/mbelib -DPERSEUS_DIR=/opt/install/libperseus -DXTRX_DIR=/opt/install/xtrx-images -DSOAPYSDR_DIR=/opt/install/SoapySDR -DCMAKE_INSTALL_PREFIX=/opt/install/sdrangel .. \ - && make -j8 install - -# Start some services on which SDRangel depends -RUN sudo service ssh start \ - && sudo service dbus start \ - && sudo service avahi-daemon start + \ No newline at end of file diff --git a/docker/base/gui/.dockerignore b/docker/base/gui/.dockerignore new file mode 100644 index 000000000..b4387cea6 --- /dev/null +++ b/docker/base/gui/.dockerignore @@ -0,0 +1,3 @@ +build.sh +linux/ +vanilla/ \ No newline at end of file diff --git a/docker/base/gui/Dockerfile b/docker/base/gui/Dockerfile new file mode 100644 index 000000000..e8754d603 --- /dev/null +++ b/docker/base/gui/Dockerfile @@ -0,0 +1,14 @@ +FROM sdrangel/bionic:base + +# Finally SDRangel +RUN cd /opt/build \ + && git clone https://github.com/f4exb/sdrangel.git \ + && cd sdrangel \ + && git reset --hard v4.5.0 \ + && mkdir build; cd build \ + && cmake -Wno-dev -DDEBUG_OUTPUT=ON -DBUILD_TYPE=RELEASE -DRX_SAMPLE_24BIT=ON -DBUILD_SERVER=OFF -DMIRISDR_DIR=/opt/install/libmirisdr -DAIRSPY_DIR=/opt/install/libairspy -DAIRSPYHF_DIR=/opt/install/libairspyhf -DBLADERF_DIR=/opt/install/libbladeRF -DHACKRF_DIR=/opt/install/libhackrf -DRTLSDR_DIR=/opt/install/librtlsdr -DLIMESUITE_DIR=/opt/install/LimeSuite -DIIO_DIR=/opt/install/libiio -DCM256CC_DIR=/opt/install/cm256cc -DDSDCC_DIR=/opt/install/dsdcc -DSERIALDV_DIR=/opt/install/serialdv -DMBE_DIR=/opt/install/mbelib -DCODEC2_DIR=/opt/install/codec2 -DPERSEUS_DIR=/opt/install/libperseus -DXTRX_DIR=/opt/install/xtrx-images -DSOAPYSDR_DIR=/opt/install/SoapySDR -DCMAKE_INSTALL_PREFIX=/opt/install/sdrangel .. \ + && make -j8 install + +# Configure SSH for X-forwarding to be able to start the UI from ssh connection +RUN sudo sed -i '/X11Forwarding/c\X11Forwarding yes' /etc/ssh/sshd_config \ + && sudo sed -i '/X11UseLocalhost/c\X11UseLocalhost no' /etc/ssh/sshd_config diff --git a/docker/base/gui/linux/nvidia/.dockerignore b/docker/base/gui/linux/nvidia/.dockerignore new file mode 100644 index 000000000..9460306d2 --- /dev/null +++ b/docker/base/gui/linux/nvidia/.dockerignore @@ -0,0 +1,4 @@ +.gitignore +NVIDIA-Linux* +build.sh +run.sh \ No newline at end of file diff --git a/docker/base/gui/linux/nvidia/.gitignore b/docker/base/gui/linux/nvidia/.gitignore new file mode 100644 index 000000000..a2a20a649 --- /dev/null +++ b/docker/base/gui/linux/nvidia/.gitignore @@ -0,0 +1 @@ +*.run \ No newline at end of file diff --git a/docker/base/gui/linux/nvidia/Dockerfile b/docker/base/gui/linux/nvidia/Dockerfile new file mode 100644 index 000000000..2e1c9dafc --- /dev/null +++ b/docker/base/gui/linux/nvidia/Dockerfile @@ -0,0 +1,16 @@ +FROM sdrangel/bionic:gui + +RUN sudo apt-get update && sudo apt-get install -y mesa-utils binutils kmod + +# install nvidia driver +ADD NVIDIA-DRIVER.run /tmp/NVIDIA-DRIVER.run +RUN sudo sh /tmp/NVIDIA-DRIVER.run -s --ui=none --no-kernel-module --install-libglvnd --no-questions +RUN sudo rm /tmp/NVIDIA-DRIVER.run + +# debug +RUN sudo apt-get update && sudo apt-get install -y gdb alsa-utils +RUN sudo usermod -a -G adm sdr + +# Start SDRangel and some more services on which SDRangel depends +COPY start.sh /start.sh +ENTRYPOINT ["/start.sh"] diff --git a/docker/base/gui/linux/nvidia/run.sh b/docker/base/gui/linux/nvidia/run.sh new file mode 100755 index 000000000..631cd4409 --- /dev/null +++ b/docker/base/gui/linux/nvidia/run.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +COMMAND="/bin/bash" + +xhost +si:localuser:root # allow connections to X server +xhost +si:localuser:${USER} +#docker run --privileged -e "DISPLAY=unix:0.0" -p 50022:22 -v="/tmp/.X11-unix:/tmp/.X11-unix:rw" -v="/tmp/debug:/opt/build/sdrangel/debug:rw" -i -t --rm sdrangel/bionic:linux_nvidia $COMMAND +docker run -it --rm --privileged \ + -e "DISPLAY=unix:0.0" \ + -p 50022:22 \ + -v="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ + -v="/home/${USER}/.config/f4exb:/home/sdr/.config/f4exb:rw" \ + sdrangel/bionic:linux_nvidia $COMMAND diff --git a/docker/base/gui/linux/nvidia/start.sh b/docker/base/gui/linux/nvidia/start.sh new file mode 100755 index 000000000..a67ecab72 --- /dev/null +++ b/docker/base/gui/linux/nvidia/start.sh @@ -0,0 +1,6 @@ +#!/bin/bash +sudo service ssh start +sudo service dbus start +sudo service avahi-daemon start +/bin/bash +#/opt/install/sdrangel/bin/sdrangel # not ready yet \ No newline at end of file diff --git a/docker/base/gui/vanilla/.dockerignore b/docker/base/gui/vanilla/.dockerignore new file mode 100644 index 000000000..b6d842ab5 --- /dev/null +++ b/docker/base/gui/vanilla/.dockerignore @@ -0,0 +1,2 @@ +build.sh +run.sh \ No newline at end of file diff --git a/docker/base/gui/vanilla/Dockerfile b/docker/base/gui/vanilla/Dockerfile new file mode 100644 index 000000000..7913bec6a --- /dev/null +++ b/docker/base/gui/vanilla/Dockerfile @@ -0,0 +1,5 @@ +FROM sdrangel/bionic:gui + +# Start SDRangel and some more services on which SDRangel depends +COPY start.sh /start.sh +ENTRYPOINT ["/start.sh"] \ No newline at end of file diff --git a/docker/base/gui/vanilla/run.sh b/docker/base/gui/vanilla/run.sh new file mode 100755 index 000000000..5ef871e0c --- /dev/null +++ b/docker/base/gui/vanilla/run.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +COMMAND="/bin/bash" + +xhost +si:localuser:root # allow connections to X server +xhost +si:localuser:${USER} +docker run --privileged -e "DISPLAY=unix:0.0" -p 50022:22 -v="/tmp/.X11-unix:/tmp/.X11-unix:rw" -v="/home/${USER}/.config/f4exb:/home/sdr/.config/f4exb:rw" -i -t --rm sdrangel/bionic:vanilla $COMMAND diff --git a/docker/base/gui/vanilla/start.sh b/docker/base/gui/vanilla/start.sh new file mode 100755 index 000000000..a67ecab72 --- /dev/null +++ b/docker/base/gui/vanilla/start.sh @@ -0,0 +1,6 @@ +#!/bin/bash +sudo service ssh start +sudo service dbus start +sudo service avahi-daemon start +/bin/bash +#/opt/install/sdrangel/bin/sdrangel # not ready yet \ No newline at end of file diff --git a/docker/base/server/.dockerignore b/docker/base/server/.dockerignore new file mode 100644 index 000000000..b6d842ab5 --- /dev/null +++ b/docker/base/server/.dockerignore @@ -0,0 +1,2 @@ +build.sh +run.sh \ No newline at end of file diff --git a/docker/base/server/Dockerfile b/docker/base/server/Dockerfile new file mode 100644 index 000000000..5d3a28c88 --- /dev/null +++ b/docker/base/server/Dockerfile @@ -0,0 +1,14 @@ +FROM sdrangel/bionic:base + +# Finally SDRangel +RUN cd /opt/build \ + && git clone https://github.com/f4exb/sdrangel.git \ + && cd sdrangel \ + && git reset --hard v4.5.0 \ + && mkdir build; cd build \ + && cmake -Wno-dev -DDEBUG_OUTPUT=ON -DBUILD_TYPE=RELEASE -DRX_SAMPLE_24BIT=ON -DBUILD_GUI=OFF -DMIRISDR_DIR=/opt/install/libmirisdr -DAIRSPY_DIR=/opt/install/libairspy -DAIRSPYHF_DIR=/opt/install/libairspyhf -DBLADERF_DIR=/opt/install/libbladeRF -DHACKRF_DIR=/opt/install/libhackrf -DRTLSDR_DIR=/opt/install/librtlsdr -DLIMESUITE_DIR=/opt/install/LimeSuite -DIIO_DIR=/opt/install/libiio -DCM256CC_DIR=/opt/install/cm256cc -DDSDCC_DIR=/opt/install/dsdcc -DSERIALDV_DIR=/opt/install/serialdv -DMBE_DIR=/opt/install/mbelib -DCODEC2_DIR=/opt/install/codec2 -DPERSEUS_DIR=/opt/install/libperseus -DXTRX_DIR=/opt/install/xtrx-images -DSOAPYSDR_DIR=/opt/install/SoapySDR -DCMAKE_INSTALL_PREFIX=/opt/install/sdrangel .. \ + && make -j8 install + +# Start SDRangel and some more services on which SDRangel depends +COPY start.sh /start.sh +ENTRYPOINT ["/start.sh"] \ No newline at end of file diff --git a/docker/base/server/run.sh b/docker/base/server/run.sh new file mode 100755 index 000000000..b1be659a9 --- /dev/null +++ b/docker/base/server/run.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +COMMAND="/bin/bash" + +docker run --privileged -p 50022:22 -v="/home/${USER}/.config/f4exb:/home/sdr/.config/f4exb:rw" -i -t --rm sdrangel/bionic:server $COMMAND diff --git a/docker/base/server/start.sh b/docker/base/server/start.sh new file mode 100755 index 000000000..ded8d2dd9 --- /dev/null +++ b/docker/base/server/start.sh @@ -0,0 +1,6 @@ +#!/bin/bash +sudo systemctl start ssh +sudo systemctl start dbus +sudo systemctl start avahi-daemon +/bin/bash +#/opt/install/sdrangel/bin/sdrangelsrv # not ready yet \ No newline at end of file diff --git a/docker/readme.md b/docker/readme.md new file mode 100644 index 000000000..9f57fa9af --- /dev/null +++ b/docker/readme.md @@ -0,0 +1,65 @@ +