aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fr24feed/Dockerfile
blob: e13eb0b8f7d6c7bb8a987bb071aea35c950090bf (plain) (blame)
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
# Alpine is a bit too extreme (it doesn't have /etc/localtime, no support for
# hostname -I, etc.).
FROM debian:bullseye-slim AS base

# Those are weird hacks, but the alternative (using the Flightradar24 apt
# repository) was unsuitable (no systemctl in the container, etc.).
# Using BuildKit is required for this to work (it exposes TARGETARCH).

# The latest versions of the fr24feed binary for i386/x86_64/armhf according
# to:
#
#     https://www.flightradar24.com/share-your-data
#
# as of 2023-12-10.
FROM base AS env-386
ENV fr24feed_directory=linux_x86_binaries
ENV fr24feed_version=1.0.44-0
ENV fr24feed_archive_suffix=i386

FROM base AS env-amd64
ENV fr24feed_directory=linux_x86_64_binaries
ENV fr24feed_version=1.0.44-0
ENV fr24feed_archive_suffix=amd64

FROM base AS env-arm
ENV fr24feed_directory=rpi_binaries
ENV fr24feed_version=1.0.44-0
ENV fr24feed_archive_suffix=armhf

ARG TARGETARCH
FROM env-$TARGETARCH AS builder

ENV fr24feed_archive_name="fr24feed_${fr24feed_version}_${fr24feed_archive_suffix}.tgz"
WORKDIR /tmp
ADD ["https://repo-feed.flightradar24.com/$fr24feed_directory/$fr24feed_archive_name", "./"]
RUN tar xzf "$fr24feed_archive_name"

FROM env-$TARGETARCH

LABEL maintainer="Egor Tensin <Egor.Tensin@gmail.com>"

ENV fr24feed_directory="fr24feed_${fr24feed_archive_suffix}"

    # fr24feed dependencies:
RUN runtime_deps='ca-certificates procps' && \
    apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
        apt-get install -y --no-install-recommends $runtime_deps

COPY --from=builder ["/tmp/$fr24feed_directory", "/tmp/$fr24feed_directory/"]
COPY ["fr24feed.ini", "/etc/"]

EXPOSE 8754

WORKDIR "/tmp/$fr24feed_directory"
CMD ["./fr24feed"]