-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
70 lines (65 loc) · 2.12 KB
/
Dockerfile
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
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"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY ./rootfs /
COPY ./bin/acars-bridge.armv7/acars-bridge /opt/acars-bridge.armv7
COPY ./bin/acars-bridge.arm64/acars-bridge /opt/acars-bridge.arm64
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/*
# ENTRYPOINT [ "/init" ]
# Add healthcheck
HEALTHCHECK --start-period=3600s --interval=600s CMD /scripts/healthcheck.sh