Skip to content

Commit

Permalink
make timelapse1090 load on demand
Browse files Browse the repository at this point in the history
instead of timelapse1090 being part of the image, just install it on
image startup if the option is enabled

this saves 12 MB image size
  • Loading branch information
wiedehopf committed May 31, 2024
1 parent de0248a commit 9b7c740
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,6 @@ RUN set -x && \
rm -rf "${TAR1090_UPDATE_DIR}" && \
# tar1090: add nginx config
cp -Rv /etc/nginx.tar1090/* /etc/nginx/ && \
# timelapse1090
git clone --single-branch --depth 1 "https://github.com/wiedehopf/timelapse1090.git" "${GITPATH_TIMELAPSE1090}" && \
pushd "${GITPATH_TIMELAPSE1090}" && \
bash -ec 'echo "timelapse1090 $(git log | head -1 | tr -s " " "_")" >> /VERSIONS' && \
# remove unused .git dir to slightly reduce image size
rm -rf "${GITPATH_TIMELAPSE1090}/.git" && \
popd && \
mkdir -p /var/timelapse1090 && \
# aircraft-db, file in TAR1090_UPDATE_DIR will be preferred when starting readsb if tar1090-update enabled
curl -o "${TAR1090_INSTALL_DIR}/aircraft.csv.gz" "https://raw.githubusercontent.com/wiedehopf/tar1090-db/csv/aircraft.csv.gz" && \
# clone graphs1090 repo
Expand Down
16 changes: 16 additions & 0 deletions rootfs/etc/s6-overlay/startup.d/11-timelapse1090
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/command/with-contenv bash
# shellcheck shell=bash disable=SC1091,SC2015,SC2153

source /scripts/common

if ! chk_enabled "${ENABLE_TIMELAPSE1090}" || chk_enabled "${TAR1090_DISABLE}"; then
exit 0
fi

if [[ -d "${GITPATH_TIMELAPSE1090}" ]]; then
exit 0
fi

# timelapse1090
git clone --single-branch --depth 1 "https://github.com/wiedehopf/timelapse1090.git" "${GITPATH_TIMELAPSE1090}"
mkdir -p /var/timelapse1090

0 comments on commit 9b7c740

Please sign in to comment.