-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.build-aiscatcher
104 lines (95 loc) · 3.54 KB
/
Dockerfile.build-aiscatcher
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
FROM debian:bookwork-slim AS build
RUN set -x && \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -q -o Dpkg::Options::="--force-confnew" --no-install-recommends -y \
git make gcc g++ cmake pkg-config librtlsdr-dev libairspy-dev libhackrf-dev libairspyhf-dev libzmq3-dev libsoxr-dev libcurl4-openssl-dev zlib1g-dev && \
git clone --depth=1 -b develop --single-branch https://github.com/jvde-github/AIS-catcher.git /root/AIS-catcher && \
cd /root/AIS-catcher && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:base
ARG TARGETPLATFORM TARGETOS TARGETARCH
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -x && \
#
echo "TARGETPLATFORM $TARGETPLATFORM" && \
echo "TARGETOS $TARGETOS" && \
echo "TARGETARCH $TARGETARCH" && \
#
# define required packages
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
SX_PACKAGES=() && \
#
SX_PACKAGES+=(sxfeeder:armhf) && \
# SX_PACKAGES+=(aiscatcher:armhf) && \
#
TEMP_PACKAGES+=(gnupg) && \
if [ "${TARGETARCH:0:3}" != "arm" ]; then KEPT_PACKAGES+=(qemu-user-static); fi && \
#
KEPT_PACKAGES+=(librtlsdr0) && \
KEPT_PACKAGES+=(libairspy0) && \
KEPT_PACKAGES+=(libhackrf0) && \
KEPT_PACKAGES+=(libairspyhf1) && \
KEPT_PACKAGES+=(libzmq5) && \
KEPT_PACKAGES+=(libsoxr0) && \
KEPT_PACKAGES+=(libcurl4) && \
KEPT_PACKAGES+=(tcpdump) && \
KEPT_PACKAGES+=(python3-bluez) && \
KEPT_PACKAGES+=(git) && \
KEPT_PACKAGES+=(nano) && \
#
# install packages
apt-get update && \
apt-get install -q -o Dpkg::Options::="--force-confnew" -y --no-install-recommends --no-install-suggests \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" \
&& \
#
# install shipxplorer packages
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 1D043681 && \
echo 'deb https://apt.rb24.com/ bullseye main' > /etc/apt/sources.list.d/rb24.list && \
#
if [ "$TARGETPLATFORM" != "linux/arm/v7" ]; then \
dpkg --add-architecture armhf; \
fi && \
#
#
# add avnav repository
curl -o /tmp/oss.boating.gpg.key https://www.free-x.de/debian/oss.boating.gpg.key && \
apt-key add /tmp/oss.boating.gpg.key && \
curl -o /etc/apt/sources.list.d/boating.list https://www.free-x.de/debian/boating.list && \
#
# now add a bunch of files
apt-get update -q && \
apt-get install -q -o Dpkg::Options::="--force-confnew" -y --no-install-recommends --no-install-suggests \
"${SX_PACKAGES[@]}" \
&& \
#
# Do some other stuff
echo "alias dir=\"ls -alsv\"" >> /root/.bashrc && \
echo "alias nano=\"nano -l\"" >> /root/.bashrc && \
#
# clean up
if [[ "${#TEMP_PACKAGES[@]}" -gt 0 ]]; then \
apt-get remove -y "${TEMP_PACKAGES[@]}"; \
fi && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/*
COPY rootfs/ /
# add AIS-catcher
COPY --from=build /usr/local/bin/AIS-catcher /usr/local/bin/AIS-catcher
# Add Container Version
RUN set -x && \
pushd /tmp && \
git clone --depth=1 -b ##BRANCH## --single-branch https://github.com/sdr-enthusiasts/docker-shipxplorer.git && \
cd docker-shipxplorer && \
echo "$(TZ=UTC date +%Y%m%d-%H%M%S)_$(git rev-parse --short HEAD)_$(git branch --show-current)" > /.CONTAINER_VERSION && \
popd && \
rm -rf /tmp/*
# Add healthcheck
HEALTHCHECK --start-period=60s --interval=600s --timeout=60s CMD /healthcheck/healthcheck.sh