2019-10-17 10:00:15 +00:00
|
|
|
# -------------------
|
|
|
|
# The build container
|
|
|
|
# -------------------
|
2022-08-29 10:54:08 +00:00
|
|
|
FROM debian:bullseye-slim AS build
|
2019-10-17 10:00:15 +00:00
|
|
|
|
2021-02-19 16:53:11 +00:00
|
|
|
# Upgrade base packages.
|
2019-10-17 10:00:15 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get upgrade -y && \
|
2021-07-19 04:08:51 +00:00
|
|
|
apt-get install -y --no-install-recommends \
|
2021-07-21 06:38:08 +00:00
|
|
|
build-essential \
|
2021-07-03 13:39:38 +00:00
|
|
|
cmake \
|
2021-07-21 06:38:08 +00:00
|
|
|
git \
|
|
|
|
libatlas-base-dev \
|
2022-07-09 03:41:29 +00:00
|
|
|
libsamplerate0-dev \
|
2021-07-21 06:38:08 +00:00
|
|
|
libusb-1.0-0-dev \
|
|
|
|
pkg-config \
|
|
|
|
python3 \
|
|
|
|
python3-dev \
|
|
|
|
python3-pip \
|
2021-07-22 13:28:09 +00:00
|
|
|
python3-setuptools \
|
|
|
|
python3-wheel && \
|
2019-10-17 10:00:15 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2021-02-19 16:53:11 +00:00
|
|
|
# Copy in requirements.txt.
|
|
|
|
COPY auto_rx/requirements.txt \
|
|
|
|
/root/radiosonde_auto_rx/auto_rx/requirements.txt
|
2020-12-23 08:25:50 +00:00
|
|
|
|
2021-02-19 16:53:11 +00:00
|
|
|
# Install Python packages.
|
2021-07-19 03:13:48 +00:00
|
|
|
RUN --mount=type=cache,target=/root/.cache/pip pip3 install \
|
2021-07-22 13:28:09 +00:00
|
|
|
--user --no-warn-script-location --ignore-installed --no-binary numpy \
|
2021-02-19 16:53:11 +00:00
|
|
|
-r /root/radiosonde_auto_rx/auto_rx/requirements.txt
|
|
|
|
|
2022-09-23 07:13:57 +00:00
|
|
|
# Compile rtl-sdr from source.
|
|
|
|
RUN git clone https://github.com/steve-m/librtlsdr.git /root/librtlsdr && \
|
|
|
|
mkdir -p /root/librtlsdr/build && \
|
|
|
|
cd /root/librtlsdr/build && \
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=/root/target/usr/local -Wno-dev ../ && \
|
|
|
|
make && \
|
|
|
|
make install && \
|
|
|
|
rm -rf /root/librtlsdr
|
|
|
|
|
2022-09-23 07:13:57 +00:00
|
|
|
# Compile spyserver_client from source.
|
|
|
|
RUN git clone https://github.com/miweber67/spyserver_client.git /root/spyserver_client && \
|
|
|
|
cd /root/spyserver_client && \
|
|
|
|
make
|
|
|
|
|
2021-02-19 16:53:11 +00:00
|
|
|
# Copy in radiosonde_auto_rx.
|
|
|
|
COPY . /root/radiosonde_auto_rx
|
2019-10-17 10:00:15 +00:00
|
|
|
|
2022-07-09 03:41:29 +00:00
|
|
|
# Build the radiosonde_auto_rx binaries.
|
2021-02-19 16:53:11 +00:00
|
|
|
WORKDIR /root/radiosonde_auto_rx/auto_rx
|
|
|
|
RUN /bin/sh build.sh
|
2019-10-17 10:00:15 +00:00
|
|
|
|
|
|
|
# -------------------------
|
|
|
|
# The application container
|
|
|
|
# -------------------------
|
2022-08-29 10:54:08 +00:00
|
|
|
FROM debian:bullseye-slim
|
2021-03-28 11:30:44 +00:00
|
|
|
|
2019-10-12 11:04:00 +00:00
|
|
|
EXPOSE 5000/tcp
|
|
|
|
|
2021-02-19 16:53:11 +00:00
|
|
|
# Upgrade base packages and install application dependencies.
|
2021-07-19 03:13:48 +00:00
|
|
|
RUN apt-get update && \
|
2019-10-16 13:08:21 +00:00
|
|
|
apt-get upgrade -y && \
|
2021-07-19 04:08:51 +00:00
|
|
|
apt-get install -y --no-install-recommends \
|
2021-07-21 06:38:08 +00:00
|
|
|
libatlas3-base \
|
2021-04-30 07:43:00 +00:00
|
|
|
libatomic1 \
|
2022-07-09 03:41:29 +00:00
|
|
|
libsamplerate0 \
|
2021-07-21 06:38:08 +00:00
|
|
|
python3 \
|
2019-10-12 11:04:00 +00:00
|
|
|
rng-tools \
|
|
|
|
sox \
|
2021-01-05 08:16:51 +00:00
|
|
|
tini \
|
2021-07-19 03:13:48 +00:00
|
|
|
usbutils && \
|
2019-10-16 13:08:21 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2019-10-12 11:04:00 +00:00
|
|
|
|
2021-07-03 13:39:38 +00:00
|
|
|
# Copy rtl-sdr from the build container.
|
|
|
|
COPY --from=build /root/target /
|
|
|
|
RUN ldconfig
|
|
|
|
|
2019-10-17 10:00:15 +00:00
|
|
|
# Copy any additional Python packages from the build container.
|
2021-02-19 16:53:11 +00:00
|
|
|
COPY --from=build /root/.local /root/.local
|
2019-10-16 13:08:21 +00:00
|
|
|
|
2019-10-17 10:00:15 +00:00
|
|
|
# Copy auto_rx from the build container to /opt.
|
2021-02-19 16:53:11 +00:00
|
|
|
COPY --from=build /root/radiosonde_auto_rx/LICENSE /opt/auto_rx/
|
|
|
|
COPY --from=build /root/radiosonde_auto_rx/auto_rx/ /opt/auto_rx/
|
2019-10-16 13:08:21 +00:00
|
|
|
|
2022-07-09 03:41:29 +00:00
|
|
|
# Copy ss_client from the build container and create links
|
|
|
|
COPY --from=build /root/spyserver_client/ss_client /opt/auto_rx/
|
|
|
|
RUN ln -s ss_client /opt/auto_rx/ss_iq && \
|
|
|
|
ln -s ss_client /opt/auto_rx/ss_power
|
|
|
|
|
2021-01-05 08:20:00 +00:00
|
|
|
# Set the working directory.
|
2019-10-12 11:04:00 +00:00
|
|
|
WORKDIR /opt/auto_rx
|
2021-01-05 08:16:51 +00:00
|
|
|
|
2021-02-19 16:53:11 +00:00
|
|
|
# Ensure scripts from Python packages are in PATH.
|
|
|
|
ENV PATH=/root/.local/bin:$PATH
|
|
|
|
|
2021-01-05 08:20:00 +00:00
|
|
|
# Use tini as init.
|
2021-01-05 08:16:51 +00:00
|
|
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|
|
|
|
|
|
|
|
# Run auto_rx.py.
|
2021-02-19 16:53:11 +00:00
|
|
|
CMD ["python3", "/opt/auto_rx/auto_rx.py"]
|