-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.local
152 lines (143 loc) · 4.84 KB
/
Dockerfile.local
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#build acars-bridge
FROM rust:1.81.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
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
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:acars-decoder
ENV DEVICE_INDEX="" \
QUIET_LOGS="TRUE" \
FREQUENCIES="" \
FEED_ID="" \
PPM="0"\
GAIN="-10" \
RTLMULT="160" \
SERIAL="" \
SOAPYSDR="" \
OUTPUT_SERVER="acars_router" \
OUTPUT_SERVER_PORT="5550" \
OUTPUT_SERVER_MODE="udp" \
MODE="J"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,SC2086,SC2039
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) && \
TEMP_PACKAGES+=(libusb-1.0-0-dev) && \
KEPT_PACKAGES+=(libusb-1.0-0) && \
KEPT_PACKAGES+=(libzmq5) && \
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" && \
# deploy airspyone host
git clone https://github.com/airspy/airspyone_host.git /src/airspyone_host && \
pushd /src/airspyone_host && \
mkdir -p /src/airspyone_host/build && \
pushd /src/airspyone_host/build && \
cmake ../ -DINSTALL_UDEV_RULES=ON && \
make && \
make install && \
ldconfig && \
popd && popd && \
# remove the source code
rm -rf /src/airspyone_host && \
# Deploy SoapySDR
git clone https://github.com/pothosware/SoapySDR.git /src/SoapySDR && \
pushd /src/SoapySDR && \
BRANCH_SOAPYSDR=$(git tag --sort="creatordate" | tail -1) && \
git checkout "$BRANCH_SOAPYSDR" && \
mkdir -p /src/SoapySDR/build && \
pushd /src/SoapySDR/build && \
cmake ../ -DCMAKE_BUILD_TYPE=Debug && \
make all && \
make test && \
make install && \
popd && popd && \
ldconfig && \
# remove the source code
rm -rf /src/SoapySDR && \
# Deploy SoapyRTLTCP
git clone https://github.com/pothosware/SoapyRTLTCP.git /src/SoapyRTLTCP && \
pushd /src/SoapyRTLTCP && \
mkdir -p /src/SoapyRTLTCP/build && \
pushd /src/SoapyRTLTCP/build && \
cmake ../ -DCMAKE_BUILD_TYPE=Debug && \
make all && \
make install && \
popd && popd && \
ldconfig && \
# remove the source code
rm -rf /src/SoapyRTLTCP && \
# Deploy SoapyRTLSDR
git clone https://github.com/pothosware/SoapyRTLSDR.git /src/SoapyRTLSDR && \
pushd /src/SoapyRTLSDR && \
BRANCH_SOAPYRTLSDR=$(git tag --sort="creatordate" | tail -1) && \
git checkout "$BRANCH_SOAPYRTLSDR" && \
mkdir -p /src/SoapyRTLSDR/build && \
pushd /src/SoapyRTLSDR/build && \
cmake ../ -DCMAKE_BUILD_TYPE=Debug && \
make all && \
make install && \
popd && popd && \
ldconfig && \
# remove the source code
rm -rf /src/SoapyRTLSDR && \
# install sdrplay support for soapy
# install sdrplay
curl --location --output /tmp/install_sdrplay.sh https://github.com/raw/sdr-enthusiasts/install-libsdrplay/main/install_sdrplay.sh && \
chmod +x /tmp/install_sdrplay.sh && \
/tmp/install_sdrplay.sh && \
# Deploy Airspy
git clone https://github.com/pothosware/SoapyAirspy.git /src/SoapyAirspy && \
pushd /src/SoapyAirspy && \
mkdir build && \
pushd build && \
cmake .. && \
make && \
make install && \
popd && \
popd && \
ldconfig && \
# remove the source code
rm -rf /src/SoapyAirspy && \
# acarsdec
#git clone --depth 1 --single-branch --branch master https://github.com/TLeconte/acarsdec /src/acarsdec && \
git clone --depth 1 --single-branch --branch master https://github.com/wiedehopf/acarsdec.git /src/acarsdec && \
pushd /src/acarsdec && \
#git checkout master && \
#git checkout testing && \
sed -i -e 's/-march=native//' CMakeLists.txt && \
mkdir build && \
pushd build && \
cmake ../ -DCMAKE_BUILD_TYPE=Debug -Drtl=OFF -Dsdrplay=OFF -Dairspy=OFF -Dsoapy=ON && \
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/*
COPY rootfs/ /
COPY --from=builder /tmp/acars-bridge/acars-bridge /opt/acars-bridge
# ENTRYPOINT [ "/init" ]
# Add healthcheck
HEALTHCHECK --start-period=3600s --interval=600s CMD /scripts/healthcheck.sh