This repository has been archived by the owner on May 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.old
150 lines (147 loc) · 4.88 KB
/
Dockerfile.old
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
FROM debian:buster-20220125-slim
# Raspbian 32 bit sucks and we can't run recent versions of bullseye
#FROM debian:bullseye-20211220-slim
ENV BRANCH_RTLSDR="ed0317e6a58c098874ac58b769cf2e609c18d9a5" \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY rootfs/ /
# hadolint ignore=DL3008,SC2086
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) && \
# logging
KEPT_PACKAGES+=(gawk) && \
KEPT_PACKAGES+=(pv) && \
# required for S6 overlay
# curl kept for healthcheck
# ca-certificates kept for python
TEMP_PACKAGES+=(xz-utils) && \
KEPT_PACKAGES+=(file) && \
KEPT_PACKAGES+=(curl) && \
KEPT_PACKAGES+=(ca-certificates) && \
# libusb-1.0-0 + dev - Required for rtl-sdr, libiio (bladeRF/PlutoSDR).
KEPT_PACKAGES+=(libusb-1.0-0) && \
TEMP_PACKAGES+=(libusb-1.0-0-dev) && \
# packages for libacars
TEMP_PACKAGES+=(zlib1g-dev) && \
TEMP_PACKAGES+=(libxml2-dev) && \
KEPT_PACKAGES+=(zlib1g) && \
KEPT_PACKAGES+=(libxml2) && \
# packages for acarsserv
TEMP_PACKAGES+=(libsqlite3-dev) && \
KEPT_PACKAGES+=(libsqlite3-0) && \
# packages for network stuff
KEPT_PACKAGES+=(socat) && \
KEPT_PACKAGES+=(ncat) && \
KEPT_PACKAGES+=(net-tools) && \
# Packages for nginx
KEPT_PACKAGES+=(nginx-light) && \
# packages for python
KEPT_PACKAGES+=(python3) && \
KEPT_PACKAGES+=(python3-pip) && \
KEPT_PACKAGES+=(python3-setuptools) && \
KEPT_PACKAGES+=(python3-wheel) && \
# KEPT_PACKAGES+=(gunicorn3) && \
TEMP_PACKAGES+=(python3-dev) && \
# process management
KEPT_PACKAGES+=(procps) && \
# stats
KEPT_PACKAGES+=(rrdtool) && \
TEMP_PACKAGES+=(librrd-dev) && \
# packages for dumpvdl2
TEMP_PACKAGES+=(libglib2.0-dev) && \
KEPT_PACKAGES+=(libglib2.0-0) && \
# install packages
## Builder fixes...
mkdir -p /usr/sbin/ && \
ln -s /usr/bin/dpkg-split /usr/sbin/dpkg-split && \
ln -s /usr/bin/dpkg-deb /usr/sbin/dpkg-deb && \
ln -s /bin/tar /usr/sbin/tar && \
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}"\
&& \
mkdir /src/ && \
pushd /src/ && \
curl -O https://raw.githubusercontent.com/fredclausen/docker-acarshub/main/rootfs/webapp/requirements.txt && \
python3 -m pip install --no-cache-dir \
-r /src/requirements.txt \
&& \
# Fix for Eventlet issues
apt-get \
-o Dpkg::Options::='--force-confmiss' \
install --reinstall --no-install-recommends -y \
netbase \
&& \
popd && \
# rtl-sdr
git clone git://git.osmocom.org/rtl-sdr.git /src/rtl-sdr && \
pushd /src/rtl-sdr && \
git checkout "${BRANCH_RTLSDR}" && \
echo "rtl-sdr ${BRANCH_RTLSDR}" >> /VERSIONS && \
mkdir -p /src/rtl-sdr/build && \
pushd /src/rtl-sdr/build && \
cmake ../ -DINSTALL_UDEV_RULES=ON -Wno-dev && \
make -Wstringop-truncation && \
make -Wstringop-truncation install && \
cp -v /src/rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/ && \
popd && popd && \
# libacars
git clone https://github.com/szpajder/libacars.git /src/libacars && \
pushd /src/libacars && \
git checkout master && \
mkdir build && \
pushd build && \
cmake ../ && \
make && \
make install && \
popd && popd && \
# acarsdec
#git clone https://github.com/fredclausen/acarsdec.git /src/acarsdec && \
git clone --single-branch --branch testing https://github.com/airframesio/acarsdec.git /src/acarsdec && \
pushd /src/acarsdec && \
#git checkout master && \
git checkout testing && \
mkdir build && \
pushd build && \
cmake ../ -Drtl=ON && \
make && \
make install && \
popd && popd && \
# dumpvdl2
pushd /src/ && \
git clone https://github.com/szpajder/dumpvdl2.git && \
pushd dumpvdl2 && \
mkdir build && \
pushd build && \
cmake ../ && \
make && \
make install && \
popd && popd && \
# install S6 Overlay
curl -s https://raw.githubusercontent.com/mikenye/deploy-s6-overlay/master/deploy-s6-overlay.sh | sh && \
# deploy healthchecks framework
git clone \
--depth=1 \
https://github.com/mikenye/docker-healthchecks-framework.git \
/opt/healthchecks-framework \
&& \
rm -rf \
/opt/healthchecks-framework/.git* \
/opt/healthchecks-framework/*.md \
/opt/healthchecks-framework/tests \
&& \
# Clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/*
ENTRYPOINT [ "/init" ]