Skip to content

Commit

Permalink
feat: add support for rpi4 and other architechtures (#24)
Browse files Browse the repository at this point in the history
* add support for rpi4 (arm32v7) and other architectures
  • Loading branch information
ms32035 authored Jul 2, 2020
1 parent abcd322 commit 575c1dc
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 12 deletions.
38 changes: 29 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,29 @@ RUN ./sensible-build.sh ${DEBIAN_VERSION} && \
cd package-${DEBIAN_VERSION} && \
dpkg-buildpackage -b

# CONF
FROM debian:buster as confd

ENV CONFD_VERSION v0.16.0

WORKDIR /tmp
RUN apt-get update -y && \
apt-get install -y \
sudo \
git-core \
build-essential \
golang && \
rm -rf /var/lib/apt/lists/*

RUN git clone -b ${CONFD_VERSION} --depth 1 https://github.com/kelseyhightower/confd.git && \
cd confd && \
export GOPATH=/tmp/go && \
go get github.com/BurntSushi/toml && \
go get github.com/kelseyhightower/confd/backends && \
go get github.com/kelseyhightower/confd/log && \
go get github.com/kelseyhightower/confd/resource/template && \
make

FROM debian:buster-slim as serve

ENV DEBIAN_VERSION buster
Expand Down Expand Up @@ -142,20 +165,17 @@ RUN rm /usr/lib/fr24/public_html/config.js
COPY --from=piaware /tmp/piaware_builder /tmp/piaware_builder
RUN cd /tmp/piaware_builder && dpkg -i piaware_*_*.deb && rm -rf /tmp/piaware && rm /etc/piaware.conf

ADD build /build

# FR24FEED
WORKDIR /fr24feed
ADD https://repo-feed.flightradar24.com/linux_x86_64_binaries/fr24feed_${FR24FEED_VERSION}_amd64.tgz /fr24feed
RUN tar -xzf *amd64.tgz && rm *amd64.tgz
RUN /build/fr24feed.sh

# CONFD
ADD https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64 /tmp/
RUN mkdir -p /opt/confd/bin && \
mv /tmp/confd-0.16.0-linux-amd64 /opt/confd/bin/confd && \
chmod +x /opt/confd/bin/confd
COPY --from=confd /tmp/confd/bin/confd /opt/confd/bin/confd

# S6 OVERLAY
ADD https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-amd64.tar.gz /tmp/
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && rm /tmp/s6-overlay-amd64.tar.gz
RUN /build/s6-overlay.sh

COPY /root /

EXPOSE 8754 8080 30001 30002 30003 30004 30005 30104
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ docker run -it --rm \
thomx/fr24feed-piaware /bin/bash
```

Then : `/fr24feed/fr24feed_amd64/fr24feed --signup` and follow the instructions, for technical steps, your answer doesn't matter we just need the sharing key at the end.
Then : `/fr24feed/fr24feed/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 Down
20 changes: 20 additions & 0 deletions build/fr24feed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
arch=$(uname -m)

case $arch in
armv7l)
url=https://repo-feed.flightradar24.com/rpi_binaries/fr24feed_${FR24FEED_VERSION}_armhf.tgz
dirname=fr24feed_armhf
;;
*)
url=https://repo-feed.flightradar24.com/linux_x86_64_binaries/fr24feed_${FR24FEED_VERSION}_amd64.tgz
dirname=fr24feed_amd64
;;
esac

mkdir /fr24feed && \
wget -O /fr24feed/fr24feed.tgz $url && \
cd /fr24feed && \
tar -xzf fr24feed.tgz && \
mv $dirname fr24feed && \
rm /fr24feed/fr24feed.tgz
15 changes: 15 additions & 0 deletions build/s6-overlay.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
arch=$(uname -m)

case $arch in
armv7l)
url=https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-armhf.tar.gz
;;
*)
url=https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-amd64.tar.gz
;;
esac

wget -O /tmp/s6-overlay.tar.gz $url && \
tar xzf /tmp/s6-overlay.tar.gz -C / && rm /tmp/s6-overlay.tar.gz

4 changes: 2 additions & 2 deletions 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_amd64/fr24feed
/fr24feed/fr24feed/fr24feed
else
tail -f /dev/null
fi
fi

0 comments on commit 575c1dc

Please sign in to comment.