Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
Optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasreiser committed Apr 21, 2020
1 parent b82f90d commit 7a3a413
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 32 deletions.
73 changes: 46 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FROM multiarch/debian-debootstrap:armhf-buster as dump1090

ENV DUMP1090_VERSION v3.8.1

WORKDIR /tmp
RUN apt-get update -y && \
apt-get install -y \
sudo \
Expand All @@ -20,14 +21,43 @@ RUN apt-get update -y && \
libbladerf-dev && \
rm -rf /var/lib/apt/lists/*

WORKDIR /tmp
RUN git clone -b ${DUMP1090_VERSION} --depth 1 https://github.com/flightaware/dump1090 && \
cd dump1090 && \
make




##################################################################
##
## TEMPORARY DOCKER IMAGE TO BUILD TCL-TLS
##
##################################################################
FROM multiarch/debian-debootstrap:armhf-buster as tcltls

ENV DEBIAN_VERSION buster

WORKDIR /tmp
RUN apt-get update -y && \
apt-get install -y \
sudo \
git-core \
build-essential \
debhelper \
libssl-dev \
tcl-dev \
chrpath && \
rm -rf /var/lib/apt/lists/*

RUN git clone --depth 1 http://github.com/flightaware/tcltls-rebuild.git
WORKDIR /tmp/tcltls-rebuild
RUN ./prepare-build.sh ${DEBIAN_VERSION} && \
cd package-${DEBIAN_VERSION} && \
dpkg-buildpackage -b --no-sign




##################################################################
##
## TEMPORARY DOCKER IMAGE TO BUILD PIAWARE
Expand Down Expand Up @@ -55,7 +85,6 @@ RUN apt-get update -y && \
net-tools \
tclx8.4 \
tcllib \
tcl-tls \
itcl3 \
python3-venv \
dh-systemd \
Expand All @@ -68,7 +97,9 @@ RUN apt-get update -y && \

RUN git clone -b ${PIAWARE_VERSION} --depth 1 https://github.com/flightaware/piaware_builder.git piaware_builder
WORKDIR /tmp/piaware_builder
RUN ./sensible-build.sh ${DEBIAN_VERSION} && \
COPY --from=tcltls /tmp/tcltls-rebuild /tmp/piaware_builder
RUN dpkg -i tcl-tls_*.deb && \
./sensible-build.sh ${DEBIAN_VERSION} && \
cd package-${DEBIAN_VERSION} && \
dpkg-buildpackage -b

Expand All @@ -90,7 +121,7 @@ RUN apt-get update -y && \
sudo \
git-core \
build-essential \
golang && \
golang && \
rm -rf /var/lib/apt/lists/*

RUN git clone -b ${CONFD_VERSION} --depth 1 https://github.com/kelseyhightower/confd.git && \
Expand Down Expand Up @@ -148,10 +179,6 @@ RUN apt-get update -y && \
pkg-config \
libncurses5-dev \
libbladerf-dev \
# tcl-tls
libssl-dev \
tcl-dev \
chrpath \
# rbfeeder
libjansson4 \
libncurses5 \
Expand All @@ -174,43 +201,34 @@ RUN mkdir -p /etc/modprobe.d && \
ldconfig && \
rm -rf /tmp/rtl-sdr

# TCL-TLS
RUN cd /tmp && \
git clone --depth 1 http://github.com/flightaware/tcltls-rebuild.git && \
cd tcltls-rebuild && \
./prepare-build.sh ${DEBIAN_VERSION} && \
cd package-${DEBIAN_VERSION} && \
dpkg-buildpackage -b --no-sign && \
cd ../ && \
dpkg -i tcl-tls_*.deb && \
rm tcl-tls_*.deb

# DUMP1090
WORKDIR /tmp
RUN mkdir -p /usr/lib/fr24/public_html/data
COPY --from=dump1090 /tmp/dump1090/dump1090 /usr/lib/fr24/
COPY --from=dump1090 /tmp/dump1090/public_html /usr/lib/fr24/public_html
RUN rm /usr/lib/fr24/public_html/config.js

# PIAWARE
COPY --from=piaware /tmp/piaware_builder /tmp/piaware_builder
RUN cd /tmp/piaware_builder && \
WORKDIR /tmp
COPY --from=tcltls /tmp/tcltls-rebuild /tmp
COPY --from=piaware /tmp/piaware_builder /tmp
RUN dpkg -i tcl-tls_*.deb && \
dpkg -i piaware_*_*.deb && \
rm -rf /tmp/piaware && \
rm /etc/piaware.conf

# CONFD
COPY --from=confd /tmp/confd/bin/confd /opt/confd/bin/confd

# FR24FEED
WORKDIR /fr24feed
ADD https://repo-feed.flightradar24.com/rpi_binaries/fr24feed_${FR24FEED_VERSION}_armhf.tgz /fr24feed
WORKDIR /opt/fr24feed/bin
ADD https://repo-feed.flightradar24.com/rpi_binaries/fr24feed_${FR24FEED_VERSION}_armhf.tgz /opt/fr24feed/bin
RUN tar -xzf fr24feed_*_armhf.tgz && \
mv fr24feed_armhf/* . && \
rm -r fr24feed_armhf/ && \
rm fr24feed_*_armhf.tgz

# RBFEEDER
WORKDIR /rbfeeder
WORKDIR /tmp
RUN wget -U "Debian APT-HTTP/1.3" https://apt.rb24.com/pool/main/r/rbfeeder/rbfeeder_${RBFEEDER_VERSION}_armhf.deb && \
ar x rbfeeder_*_armhf.deb && \
rm rbfeeder_*_armhf.deb && \
Expand All @@ -220,7 +238,8 @@ RUN wget -U "Debian APT-HTTP/1.3" https://apt.rb24.com/pool/main/r/rbfeeder/rbfe
rm data.tar* && \
rm -r lib/ && \
rm -r etc/ && \
cp usr/bin/* /rbfeeder && \
mkdir -p /opt/rbfeeder/bin && \
cp usr/bin/* /opt/rbfeeder/bin && \
rm -r usr/

# S6 OVERLAY
Expand All @@ -234,4 +253,4 @@ RUN rm -r /tmp/*

EXPOSE 8754 8080 30001 30002 30003 30004 30005 30104

ENTRYPOINT ["/init"]
ENTRYPOINT ["/init"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ docker run -it --rm \
-e "SERVICE_ENABLE_RBFEEDER=false" \
thomasreiser/flightfeeder /bin/bash
```
Then : `/fr24feed/fr24feed --signup` and follow the instructions, for technical steps, your answer doesn't matter we just need the sharing key at the end.
Then : `/opt/fr24feed/bin/fr24feed --signup` and follow the instructions, for technical steps, your answer doesn't matter we just need the sharing key at the end.

Finally to see the sharing key run `cat /etc/fr24feed.ini`, you can now exit the container.

Expand All @@ -112,7 +112,7 @@ docker run -it --rm \
thomasreiser/flightfeeder /bin/bash
```

Then : `/rbfeeder/rbfeeder` to do an initial startup which will also create a new key for you. Use this key then to claim this station in your RadarBox account at https://www.radarbox.com/raspberry-pi/claim.
Then : `/opt/rbfeeder/bin/rbfeeder` to do an initial startup which will also create a new key for you. Use this key then to claim this station in your RadarBox account at https://www.radarbox.com/raspberry-pi/claim.

Add the environment variable `RBFEEDER_KEY` with your sharing key.

Expand Down Expand Up @@ -142,4 +142,4 @@ If you don't want to download the limit every time you bring up the container yo

Clone this repository into your Raspberry Pi.

```docker build . ```
```docker build . ```
2 changes: 1 addition & 1 deletion root/etc/services.d/fr24feed/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash
if [ "$SERVICE_ENABLE_FR24FEED" != "false" ]
then
/fr24feed/fr24feed
/opt/fr24feed/bin/fr24feed
else
tail -f /dev/null
fi
2 changes: 1 addition & 1 deletion root/etc/services.d/rbfeeder/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash
if [ "$SERVICE_ENABLE_RBFEEDER" != "false" ]
then
/rbfeeder/rbfeeder
/opt/rbfeeder/bin/rbfeeder
else
tail -f /dev/null
fi

0 comments on commit 7a3a413

Please sign in to comment.