File: Dockerfile

package info (click to toggle)
readsb 3.16-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,144 kB
  • sloc: ansic: 33,749; sh: 261; makefile: 203; python: 9
file content (44 lines) | stat: -rw-r--r-- 1,862 bytes parent folder | download
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
FROM ghcr.io/wiedehopf/readsb-builder:latest AS builder

SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
RUN --mount=type=bind,source=.,target=/app/git \
    cd /app/git && \
    READSB_BUILD_DIR=$(mktemp -d) && \
    cp -aT /app/git $READSB_BUILD_DIR && \
    cd $READSB_BUILD_DIR && \
    [[ $(uname -m) == x86_64 ]] && MARCH=" -march=nehalem" || MARCH="" && \
    make -j$(nproc) RTLSDR=yes OPTIMIZE="-O2 $MARCH" && \
    mv readsb /usr/local/bin && \
    mv viewadsb /usr/local/bin && \
    chmod +x /usr/local/bin/viewadsb /usr/local/bin/readsb && \
    make clean && \
    make -j$(nproc) PRINT_UUIDS=yes TRACKS_UUID=yes OPTIMIZE="-O2 $MARCH" && \
    mv readsb /usr/local/bin/readsb-uuid && \
    mv viewadsb /usr/local/bin/viewadsb-uuid && \
    chmod +x /usr/local/bin/viewadsb-uuid && \
    chmod +x /usr/local/bin/readsb-uuid && \
    rm -rf $READSB_BUILD_DIR && \
    mkdir -p  /usr/local/share/tar1090 && \
    wget -O /usr/local/share/tar1090/aircraft.csv.gz https://github.com/wiedehopf/tar1090-db/raw/csv/aircraft.csv.gz && \
    true

FROM debian:bookworm-slim
RUN \
    --mount=type=bind,from=builder,source=/,target=/builder/ \
    apt-get update && \
    apt-get -y install --no-install-recommends \
    librtlsdr0 libncurses6 zlib1g libzstd1 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
    mkdir -p /run/readsb && \
    cp /builder/usr/local/bin/readsb* /usr/local/bin/ && \
    cp /builder/usr/local/bin/viewadsb* /usr/local/bin/ && \
    mkdir -p  /usr/local/share/tar1090 && \
    cp /builder/usr/local/share/tar1090/aircraft.csv.gz /usr/local/share/tar1090/aircraft.csv.gz && \
    cp /builder/usr/local/lib/libjemalloc.so.2 /usr/local/lib/libjemalloc.so.2 && \
    true

ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so.2
ENV MALLOC_CONF=narenas:1,tcache:false

ENTRYPOINT ["/usr/local/bin/readsb"]