Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bias T #74

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 58 additions & 53 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:acars-decoder

ENV DEVICE_INDEX="" \
QUIET_LOGS="TRUE" \
FREQUENCIES="" \
FEED_ID="" \
PPM="0"\
GAIN="400" \
SERIAL="" \
OUTPUT_SERVER="acars_router" \
OUTPUT_SERVER_PORT="5555" \
OUTPUT_SERVER_MODE="udp" \
MODE="J"
QUIET_LOGS="TRUE" \
FREQUENCIES="" \
FEED_ID="" \
PPM="0"\
GAIN="400" \
SERIAL="" \
OUTPUT_SERVER="acars_router" \
OUTPUT_SERVER_PORT="5555" \
OUTPUT_SERVER_MODE="udp" \
MODE="J"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY ./rootfs /
Expand All @@ -20,49 +20,54 @@ COPY ./bin/acars-bridge.amd64/acars-bridge /opt/acars-bridge.amd64

# hadolint ignore=DL3008,SC2086,SC2039,SC3054
RUN set -x && \
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
# Required for building multiple packages.
TEMP_PACKAGES+=(build-essential) && \
TEMP_PACKAGES+=(pkg-config) && \
TEMP_PACKAGES+=(cmake) && \
TEMP_PACKAGES+=(git) && \
TEMP_PACKAGES+=(automake) && \
TEMP_PACKAGES+=(autoconf) && \
TEMP_PACKAGES+=(wget) && \
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}"\
&& \
# ensure binaries are executable
chmod -v a+x \
/opt/acars-bridge.armv7 \
/opt/acars-bridge.arm64 \
/opt/acars-bridge.amd64 \
&& \
# remove foreign architecture binaries
/rename_current_arch_binary.sh && \
rm -fv \
/opt/acars-bridge.* \
&& \
# vdlm2dec
# git clone https://github.com/TLeconte/vdlm2dec.git /src/vdlm2dec && \
git clone https://github.com/wiedehopf/vdlm2dec.git /src/vdlm2dec && \
pushd /src/vdlm2dec && \
# fix for floating point amd64 nonsense
sed -i 's/add_compile_options(-Ofast -march=native )/add_compile_options(-O2 )/g' CMakeLists.txt && \
mkdir build && \
pushd build && \
cmake ../ -Drtl=ON -DCMAKE_BUILD_TYPE=Debug && \
make && \
make install && \
popd && popd && \
# Clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/*
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
# Required for building multiple packages.
TEMP_PACKAGES+=(build-essential) && \
TEMP_PACKAGES+=(pkg-config) && \
TEMP_PACKAGES+=(cmake) && \
TEMP_PACKAGES+=(git) && \
TEMP_PACKAGES+=(automake) && \
TEMP_PACKAGES+=(autoconf) && \
TEMP_PACKAGES+=(wget) && \
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}"\
&& \
# ensure binaries are executable
chmod -v a+x \
/opt/acars-bridge.armv7 \
/opt/acars-bridge.arm64 \
/opt/acars-bridge.amd64 \
&& \
# remove foreign architecture binaries
/rename_current_arch_binary.sh && \
rm -fv \
/opt/acars-bridge.* \
&& \
# vdlm2dec
# git clone https://github.com/TLeconte/vdlm2dec.git /src/vdlm2dec && \
git clone https://github.com/wiedehopf/vdlm2dec.git /src/vdlm2dec && \
pushd /src/vdlm2dec && \
# fix for floating point amd64 nonsense
sed -i 's/add_compile_options(-Ofast -march=native )/add_compile_options(-O2 )/g' CMakeLists.txt && \
mkdir build && \
pushd build && \
cmake ../ -Drtl=ON -DCMAKE_BUILD_TYPE=Debug && \
make && \
make install && \
popd && popd && \
# grab the bias t scripts
curl -o /etc/s6-overlay/scripts/00-rtlsdr-biastee-init https://raw.githubusercontent.com/sdr-enthusiasts/sdre-bias-t-common/main/09-rtlsdr-biastee-init && \
curl -o /etc/s6-overlay/scripts/00-rtlsdr-biastee-down https://raw.githubusercontent.com/sdr-enthusiasts/sdre-bias-t-common/main/09-rtlsdr-biastee-down && \
chmod +x /etc/s6-overlay/scripts/00-rtlsdr-biastee-init && \
chmod +x /etc/s6-overlay/scripts/00-rtlsdr-biastee-down && \
# Clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/*

# ENTRYPOINT [ "/init" ]

Expand Down
107 changes: 56 additions & 51 deletions Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,71 @@ FROM rust:1.80.0 as builder
WORKDIR /tmp/acars-bridge
# hadolint ignore=DL3008,DL3003,SC1091
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends libzmq3-dev
apt-get update && \
apt-get install -y --no-install-recommends libzmq3-dev

RUN set -x && \
git clone https://github.com/sdr-enthusiasts/acars-bridge.git . && \
cargo build --release && \
# clean up the apt-cache
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
cp /tmp/acars-bridge/target/release/acars-bridge . && \
cargo clean
git clone https://github.com/sdr-enthusiasts/acars-bridge.git . && \
cargo build --release && \
# clean up the apt-cache
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
cp /tmp/acars-bridge/target/release/acars-bridge . && \
cargo clean

FROM ghcr.io/sdr-enthusiasts/docker-baseimage:acars-decoder

ENV DEVICE_INDEX="" \
QUIET_LOGS="TRUE" \
FREQUENCIES="" \
FEED_ID="" \
PPM="0"\
GAIN="400" \
SERIAL="" \
OUTPUT_SERVER="acars_router" \
OUTPUT_SERVER_PORT="5555" \
OUTPUT_SERVER_MODE="udp" \
MODE="J"
QUIET_LOGS="TRUE" \
FREQUENCIES="" \
FEED_ID="" \
PPM="0"\
GAIN="400" \
SERIAL="" \
OUTPUT_SERVER="acars_router" \
OUTPUT_SERVER_PORT="5555" \
OUTPUT_SERVER_MODE="udp" \
MODE="J"

# hadolint ignore=DL3008,SC2086,SC2039,SC3054
RUN set -x && \
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
# Required for building multiple packages.
TEMP_PACKAGES+=(build-essential) && \
TEMP_PACKAGES+=(pkg-config) && \
TEMP_PACKAGES+=(cmake) && \
TEMP_PACKAGES+=(git) && \
TEMP_PACKAGES+=(automake) && \
TEMP_PACKAGES+=(autoconf) && \
TEMP_PACKAGES+=(wget) && \
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}"\
&& \
# vdlm2dec
# git clone https://github.com/TLeconte/vdlm2dec.git /src/vdlm2dec && \
git clone https://github.com/wiedehopf/vdlm2dec.git /src/vdlm2dec && \
pushd /src/vdlm2dec && \
# fix for floating point amd64 nonsense
sed -i 's/add_compile_options(-Ofast -march=native )/add_compile_options(-O2 )/g' CMakeLists.txt && \
mkdir build && \
pushd build && \
cmake ../ -Drtl=ON -DCMAKE_BUILD_TYPE=Debug && \
make && \
make install && \
popd && popd && \
# Clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/*
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
# Required for building multiple packages.
TEMP_PACKAGES+=(build-essential) && \
TEMP_PACKAGES+=(pkg-config) && \
TEMP_PACKAGES+=(cmake) && \
TEMP_PACKAGES+=(git) && \
TEMP_PACKAGES+=(automake) && \
TEMP_PACKAGES+=(autoconf) && \
TEMP_PACKAGES+=(wget) && \
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}"\
&& \
# vdlm2dec
# git clone https://github.com/TLeconte/vdlm2dec.git /src/vdlm2dec && \
git clone https://github.com/wiedehopf/vdlm2dec.git /src/vdlm2dec && \
pushd /src/vdlm2dec && \
# fix for floating point amd64 nonsense
sed -i 's/add_compile_options(-Ofast -march=native )/add_compile_options(-O2 )/g' CMakeLists.txt && \
mkdir build && \
pushd build && \
cmake ../ -Drtl=ON -DCMAKE_BUILD_TYPE=Debug && \
make && \
make install && \
popd && popd && \
# grab the bias t scripts
curl -o /etc/s6-overlay/scripts/00-rtlsdr-biastee-init https://raw.githubusercontent.com/sdr-enthusiasts/sdre-bias-t-common/main/09-rtlsdr-biastee-init && \
curl -o /etc/s6-overlay/scripts/00-rtlsdr-biastee-down https://raw.githubusercontent.com/sdr-enthusiasts/sdre-bias-t-common/main/09-rtlsdr-biastee-down && \
chmod +x /etc/s6-overlay/scripts/00-rtlsdr-biastee-init && \
chmod +x /etc/s6-overlay/scripts/00-rtlsdr-biastee-down && \
# Clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/*


COPY rootfs/ /
Expand Down
2 changes: 2 additions & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/00-rtlsdr-biastee/down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /etc/s6-overlay/scripts/00-rtlsdr-biastee-down
1 change: 1 addition & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/00-rtlsdr-biastee/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
2 changes: 2 additions & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/00-rtlsdr-biastee/up
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /etc/s6-overlay/scripts/00-rtlsdr-biastee-init
Empty file.
Empty file.