Skip to content

Commit

Permalink
Fix flightware mlat issues
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBiggerGuy committed Jul 13, 2018
1 parent 92e5a53 commit 68d38ed
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Expand Up @@ -176,7 +176,7 @@ services:
PIAWARE_VERSION: v3.5.3
PIAWARE_HASH: 15debeb70b1a639644aa4e7a3a93f4749a14bc61969f6b49f1f438c91f5146f4
ports:
- "8080:8080/tcp"
- "30105:30105/tcp"
depends_on:
- dump1090
env_file:
Expand Down
45 changes: 22 additions & 23 deletions flightaware/Dockerfile-flightaware
@@ -1,26 +1,32 @@
# base ########################################################################
FROM multiarch/debian-debootstrap:armhf-buster-slim as base

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl ca-certificates \
net-tools iproute2 \
tclx8.4 tcl8.6 tcllib tcl-tls itcl3 \
python3 \
procps && \
apt-get clean && \
DEBIAN_FRONTEND=noninteractive apt-get clean && \
rm -rf /var/lib/apt/lists/*


# base ########################################################################
FROM base as builder-base
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y --no-install-recommends make autoconf gcc libc6-dev


# tcllauncher #################################################################
FROM base as tcllauncher
FROM builder-base as tcllauncher

ARG TCLLAUNCHER_VERSION
ARG TCLLAUNCHER_HASH


ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends make autoconf tcl8.6-dev gcc
RUN apt-get install -y --no-install-recommends tcl8.6-dev

RUN curl --output tcllauncher.tar.gz -L "https://github.com/flightaware/tcllauncher/archive/${TCLLAUNCHER_VERSION}.tar.gz" && \
sha256sum tcllauncher.tar.gz && echo "${TCLLAUNCHER_HASH} tcllauncher.tar.gz" | sha256sum -c
Expand All @@ -34,14 +40,11 @@ RUN make install


# faup1090 ####################################################################
FROM base as faup1090
FROM builder-base as faup1090

ARG FAUP1090_VERSION
ARG FAUP1090_HASH

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends make gcc libc6-dev

RUN curl --output faup1090.tar.gz -L "https://github.com/flightaware/dump1090/archive/${FAUP1090_VERSION}.tar.gz" && \
sha256sum faup1090.tar.gz && echo "${FAUP1090_HASH} faup1090.tar.gz" | sha256sum -c
RUN mkdir faup1090 && cd faup1090 && \
Expand All @@ -50,23 +53,22 @@ WORKDIR faup1090
RUN make RTLSDR=no BLADERF=no DUMP1090_VERSION="piaware-adsb-docker" faup1090


# mlat-client #################################################################
FROM base as mlat-client
# fa-mlat-client ##############################################################
FROM builder-base as fa-mlat-client

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends python3-dev python3-pip python3-setuptools gcc libc6-dev
RUN apt-get install -y --no-install-recommends python3-dev python3-pip python3-setuptools
RUN pip3 install --upgrade shiv importlib-resources==0.8

ARG MLAT_CLIENT_VERSION
ARG MLAT_CLIENT_HASH

RUN curl --output mlat-client.tar.gz -L "https://github.com/TheBiggerGuy/mlat-client/archive/${MLAT_CLIENT_VERSION}.tar.gz" && \
sha256sum mlat-client.tar.gz && echo "${MLAT_CLIENT_HASH} mlat-client.tar.gz" | sha256sum -c
run shiv -c mlat-client -o /usr/local/bin/mlat-client /mlat-client.tar.gz
run shiv -c fa-mlat-client -o /usr/local/bin/fa-mlat-client /mlat-client.tar.gz


# piaware #####################################################################
FROM base as piaware
FROM builder-base as piaware

#COPY --from=tcllauncher /usr/lib/Tcllauncher1.6/tcllauncher.tcl /usr/lib/Tcllauncher1.6/tcllauncher.tcl
#COPY --from=tcllauncher /usr/lib/Tcllauncher1.6/tcllauncher-support.tcl /usr/lib/Tcllauncher1.6/tcllauncher-support.tcl
Expand All @@ -78,9 +80,6 @@ COPY --from=tcllauncher /opt/tcl /opt/tcl
ARG PIAWARE_VERSION
ARG PIAWARE_HASH

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends make gcc libc6-dev

RUN curl --output piaware.tar.gz -L "https://github.com/flightaware/piaware/archive/${PIAWARE_VERSION}.tar.gz" && \
sha256sum piaware.tar.gz && echo "${PIAWARE_HASH} piaware.tar.gz" | sha256sum -c
RUN mkdir piaware && cd piaware && \
Expand Down Expand Up @@ -113,12 +112,12 @@ COPY --from=piaware /usr/lib/piaware_packages /usr/lib/piaware_packages

COPY --from=faup1090 /faup1090/faup1090 /usr/lib/piaware/helpers/faup1090

COPY --from=mlat-client /usr/local/bin/mlat-client /usr/local/bin/mlat-client
COPY --from=fa-mlat-client /usr/local/bin/fa-mlat-client /usr/lib/piaware/helpers/fa-mlat-client

COPY piaware.conf /etc/piaware.conf
COPY piaware-runner.sh /usr/bin/piaware-runner

EXPOSE 8080/tcp
EXPOSE 30105/tcp

ENTRYPOINT ["piaware-runner"]

Expand Down
9 changes: 8 additions & 1 deletion flightaware/piaware-runner.sh
Expand Up @@ -33,4 +33,11 @@ else
piaware-config "feeder-id" "${FLIGHTAWARE_FEEDER_ID}"
fi

piaware -plainlog
# Fix issue with fa-mlat-client
# The fa-mlat-client is run as "nobody" with most permissions dropped.
# This causes issues with extracting to ~/.shiv (the default) so use /tmp instead.
export SHIV_ROOT='/tmp'

piaware -plainlog

exit ${?}
12 changes: 5 additions & 7 deletions flightaware/piaware.conf
@@ -1,9 +1,4 @@
# This file configures piaware and related software.
# You can edit it directly or use piaware-config from the command line
# to view and change settings.
#
# If /boot/piaware-config.txt also exists, then settings present in
# that file will override settings in this file.
# See https://flightaware.com/adsb/piaware/advanced_configuration for options

receiver-type other
receiver-host dump1090
Expand All @@ -12,4 +7,7 @@ receiver-port 30005
allow-auto-updates no
allow-manual-updates no

allow-mlat no
allow-mlat yes
mlat-results yes
mlat-results-format beast,listen,30105

0 comments on commit 68d38ed

Please sign in to comment.