-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile.mlatclient
58 lines (55 loc) · 2.3 KB
/
Dockerfile.mlatclient
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
# This container is meant to be used as a build/download container for Wiedehopf's mlat-client
# it uses debian:bookworm-slim as basis
# ----------------------------------------------------------------------------------------
# HOW TO USE IN YOUR Dockerfile:
# 1. Create a downloader image like this:
# FROM ghcr.io/sdr-enthusiasts/docker-baseimage:mlat-client as downloader
#
# 2. In your target image, start your RUN command like this:
# RUN --mount=type=bind,from=downloader,source=/,target=/downloader set -x && \
#
# 3. In your target image in that same RUN command, make sure to add this to the APT install list:
# KEPT_PACKAGES+=(python3-pkg-resources) && \
#
# 4. Also in the same RUN command for your target image, do this:
# tar zxf /downloader/mlatclient.tgz -C / && \
# ----------------------------------------------------------------------------------------
FROM debian:bookworm-20241016-slim
ENV MLATCLIENT_REPO="https://github.com/wiedehopf/mlat-client.git"
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,SC2086,DL3003
RUN \
--mount=type=bind,source=./,target=/app/ \
set -x && \
PACKAGES=() && \
# packages needed to install
PACKAGES+=(git) && \
PACKAGES+=(gcc) && \
PACKAGES+=(python3-dev) && \
PACKAGES+=(python3-setuptools) && \
PACKAGES+=(build-essential) && \
PACKAGES+=(ca-certificates) && \
# needed for diagnostics
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${PACKAGES[@]}" \
&& \
#
# Get and install mlat-client:
git clone --depth=1 "$MLATCLIENT_REPO" /src/mlat-client && \
cd /src/mlat-client && \
python3 setup.py build && \
python3 setup.py install && \
#
# Now create a tgz tarball of the mlat-client that facilitates installing on the target:
dist_pkg_target="$(ls -d /usr/local/lib/python*/dist-packages)" && \
mlatclient_target="$(which mlat-client)" && \
tar zcvf /mlatclient.tgz "${dist_pkg_target}" "${mlatclient_target}" && \
#
# Don't remove any packets, this image is meant to be used as a build image
#apt-get remove -y "${PACKAGES[@]}" && \
#apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
apt-get clean && \
rm -rf /src/* "${dist_pkg_target}" "${mlatclient_target}" && \
bash /app/scripts/clean-build.sh