2024-07-23 19:47:06 +00:00
|
|
|
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:mlatclient as buildimage
|
|
|
|
|
|
|
|
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
|
|
|
|
RUN \
|
|
|
|
--mount=type=bind,source=./,target=/app/ \
|
|
|
|
apt-get update -q -y && \
|
|
|
|
apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \
|
|
|
|
build-essential && \
|
|
|
|
gcc -static /app/downloads/distance-in-meters.c -o /distance -lm -O2
|
2024-06-11 19:18:32 +00:00
|
|
|
|
2023-03-22 16:15:26 +00:00
|
|
|
FROM ghcr.io/sdr-enthusiasts/docker-tar1090:latest
|
2023-03-21 19:56:02 +00:00
|
|
|
|
2023-03-23 17:29:49 +00:00
|
|
|
LABEL org.opencontainers.image.source = "https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder"
|
2023-03-21 19:56:02 +00:00
|
|
|
|
2023-03-27 17:21:53 +00:00
|
|
|
ENV URL_MLAT_CLIENT_REPO="https://github.com/wiedehopf/mlat-client.git" \
|
2023-03-21 19:56:02 +00:00
|
|
|
PRIVATE_MLAT="false" \
|
|
|
|
MLAT_INPUT_TYPE="auto"
|
|
|
|
|
2024-07-23 19:47:06 +00:00
|
|
|
ARG VERSION_REPO="sdr-enthusiasts/docker-adsb-ultrafeeder" \
|
|
|
|
VERSION_BRANCH="##BRANCH##"
|
|
|
|
|
2024-06-01 18:19:19 +00:00
|
|
|
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
|
2024-06-11 19:18:32 +00:00
|
|
|
RUN \
|
2024-07-24 16:29:13 +00:00
|
|
|
--mount="type=bind,from=buildimage,source=/,target=/buildimage/" \
|
2024-06-11 19:18:32 +00:00
|
|
|
TEMP_PACKAGES=() && \
|
2023-03-21 19:56:02 +00:00
|
|
|
KEPT_PACKAGES=() && \
|
2023-07-29 20:58:16 +00:00
|
|
|
# Needed to run the mlat_client:
|
2024-06-11 19:18:32 +00:00
|
|
|
KEPT_PACKAGES+=(python3-minimal) && \
|
2024-05-26 16:43:00 +00:00
|
|
|
KEPT_PACKAGES+=(python3-pkg-resources) && \
|
2023-07-29 20:58:16 +00:00
|
|
|
#
|
|
|
|
# packages needed for debugging - these can stay out in production builds:
|
2023-04-28 14:04:43 +00:00
|
|
|
#KEPT_PACKAGES+=(procps nano aptitude psmisc) && \
|
2023-07-29 20:58:16 +00:00
|
|
|
# Install all these packages:
|
2023-03-21 19:56:02 +00:00
|
|
|
apt-get update -q -y && \
|
2023-04-28 14:04:43 +00:00
|
|
|
apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \
|
2024-07-24 16:29:13 +00:00
|
|
|
"${KEPT_PACKAGES[@]}" \
|
|
|
|
"${TEMP_PACKAGES[@]}" && \
|
2024-06-11 19:18:32 +00:00
|
|
|
# Get mlat-client
|
2024-07-23 19:47:06 +00:00
|
|
|
tar zxf /buildimage/mlatclient.tgz -C / && \
|
2023-07-29 20:58:16 +00:00
|
|
|
ln -s /usr/local/bin/mlat-client /usr/bin/mlat-client && \
|
2024-07-23 19:47:06 +00:00
|
|
|
# Get distance binary
|
|
|
|
cp -f /buildimage/distance /usr/local/bin/distance && \
|
2024-06-11 23:49:43 +00:00
|
|
|
# Add Container Version
|
2024-07-23 19:47:06 +00:00
|
|
|
[[ "${VERSION_BRANCH:0:1}" == "#" ]] && VERSION_BRANCH="main" || true && \
|
2024-07-24 16:29:13 +00:00
|
|
|
echo "$(TZ=UTC date +%Y%m%d-%H%M%S)_$(curl -ssL "https://api.github.com/repos/$VERSION_REPO/commits/$VERSION_BRANCH" | awk '{if ($1=="\"sha\":") {print substr($2,2,7); exit}}')_$VERSION_BRANCH" > /.CONTAINER_VERSION && \
|
|
|
|
# Clean up:
|
2024-06-01 16:10:11 +00:00
|
|
|
apt-get remove -q -y "${TEMP_PACKAGES[@]}" && \
|
2023-03-21 19:56:02 +00:00
|
|
|
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
|
|
|
|
apt-get clean -q -y && \
|
2024-06-11 19:18:32 +00:00
|
|
|
# test mlat-client
|
|
|
|
/usr/bin/mlat-client --help > /dev/null && \
|
|
|
|
# remove pycache introduced by testing mlat-client
|
|
|
|
find /usr | grep -E "/__pycache__$" | xargs rm -rf || true && \
|
2024-07-24 16:29:13 +00:00
|
|
|
rm -rf /src "/tmp/*" "/var/lib/apt/lists/*" /git "/var/cache/*" && \
|
2023-07-29 20:58:16 +00:00
|
|
|
#
|
|
|
|
# Do some stuff for kx1t's convenience:
|
2023-03-21 19:56:02 +00:00
|
|
|
echo "alias dir=\"ls -alsv\"" >> /root/.bashrc && \
|
|
|
|
echo "alias nano=\"nano -l\"" >> /root/.bashrc
|
|
|
|
|
|
|
|
COPY rootfs/ /
|