From b8ccbefd8e3546e5bb8df9215ca697a1a9ce8048 Mon Sep 17 00:00:00 2001 From: Daniel sa2kng Date: Tue, 24 Nov 2020 10:45:40 +0100 Subject: [PATCH] Add files via upload --- Dockerfile | 24 ++++++++++++++++++++++++ docker_build.sh | 4 ++++ run.sh | 2 ++ satnogs-config | 12 ++++++++++++ supervisord.conf | 19 +++++++++++++++++++ 5 files changed, 61 insertions(+) create mode 100644 Dockerfile create mode 100644 docker_build.sh create mode 100644 run.sh create mode 100644 satnogs-config create mode 100644 supervisord.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9c94fd3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM debian:buster +MAINTAINER sa2kng + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install wget gnupg && rm -rf /var/lib/apt/lists/* +RUN echo deb http://download.opensuse.org/repositories/home:/librespace:/satnogs/Debian_10/ ./> /etc/apt/sources.list.d/satnogs.list +RUN wget -qO - http://download.opensuse.org/repositories/home:/librespace:/satnogs/Debian_10/Release.key | DEBIAN_FRONTEND=noninteractive apt-key --keyring /etc/apt/trusted.gpg.d/satnogs.gpg add - + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install supervisor software-properties-common libhamlib-utils vorbis-tools unzip git python3-pip python3-urllib3 python3-certifi python3-chardet python3-cycler python3-decorator python3-idna python3-kiwisolver python3-pyparsing python3-tz python3-tzlocal python3-libhamlib2 rtl-sdr satnogs-flowgraphs gr-soapy gr-satnogs && rm -rf /var/lib/apt/lists/* +#RUN pip3 install satnogs-client + +RUN groupadd -g 995 satnogs && useradd -g satnogs -G dialout,plugdev -m -d /var/lib/satnogs -s /bin/false -u 999 satnogs +ADD supervisord.conf /etc/supervisor/supervisord.conf +#RUN echo "#!/bin/bash\n/usr/bin/rigctld -T 127.0.0.1 -m 1 &\n/usr/local/bin/satnogs-client" >> /usr/local/bin/satnogs-run.sh && chmod 0755 /usr/local/bin/satnogs-run.sh +RUN echo "#!/bin/bash\n/usr/bin/rigctld -T 127.0.0.1 -m 1 &\n/var/lib/satnogs/.local/bin/satnogs-client" >> /usr/local/bin/satnogs-run.sh && chmod 0755 /usr/local/bin/satnogs-run.sh +WORKDIR /var/lib/satnogs +USER satnogs +RUN pip3 install satnogs-client +RUN mkdir -p /var/lib/satnogs/.gnuradio/prefs/ && echo -n "gr::vmcircbuf_mmap_shm_open_factory" > /var/lib/satnogs/.gnuradio/prefs/vmcircbuf_default_factory +#RUN volk_profile + +# choose to simply fork the rigctld in background and satnogs-client in foreground, or use supervisord for the two +CMD ["/usr/bin/supervisord","-c/etc/supervisor/supervisord.conf"] +#CMD ["/usr/local/bin/satnogs-run.sh"] + diff --git a/docker_build.sh b/docker_build.sh new file mode 100644 index 0000000..c3101bd --- /dev/null +++ b/docker_build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +docker build -t satnogs-client:latest . +# --no-cache + diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..d742ec5 --- /dev/null +++ b/run.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run --name satnogs-node --device=/dev/bus/usb/ --tmpfs /tmp -v $(pwd)/satnogs-config:/var/lib/satnogs/.env -it satnogs-client:latest diff --git a/satnogs-config b/satnogs-config new file mode 100644 index 0000000..0a1cf3d --- /dev/null +++ b/satnogs-config @@ -0,0 +1,12 @@ +SATNOGS_API_TOKEN="" +SATNOGS_STATION_ID="" +SATNOGS_STATION_LAT="" +SATNOGS_STATION_LON="" +SATNOGS_STATION_ELEV="" +SATNOGS_SOAPY_RX_DEVICE="driver=rtlsdr" +SATNOGS_RX_SAMP_RATE="1.024e6" +SATNOGS_PPM_ERROR="0" +SATNOGS_RF_GAIN="20.7" +SATNOGS_ANTENNA="RX" +SATNOGS_LOG_LEVEL="INFO" + diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..e4e6860 --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,19 @@ +[supervisord] +nodaemon=true +user=satnogs +loglevel=debug + +[program:satnogs] +#command=/usr/local/bin/satnogs-client +command=/var/lib/satnogs/.local/bin/satnogs-client +#stdout_logfile=/dev/fd/1 +#stdout_logfile_maxbytes=0 +#redirect_stderr=true +autostart=true +autorestart=true + +[program:rigctld] +command=/usr/bin/rigctld -T 127.0.0.1 -m 1 +autostart=true +autorestart=true +