Skip to content

Commit

Permalink
reduce image size (#195)
Browse files Browse the repository at this point in the history
- make timelapse load on demand
- delete /var/cache/* to save some size on apt related stuff mostly
  • Loading branch information
wiedehopf authored Jun 1, 2024
1 parent 9738981 commit 82e0ebc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
10 changes: 1 addition & 9 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 Expand Up @@ -171,7 +163,7 @@ RUN set -x && \
apt-get remove -y ${TEMP_PACKAGES[@]} && \
apt-get autoremove -y && \
apt-get clean -q -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/* && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/* /var/cache/* && \
# document versions
bash -ec 'grep -v tar1090-db /VERSIONS | grep tar1090 | cut -d " " -f 2 > /CONTAINER_VERSION' && \
cat /VERSIONS && \
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 82e0ebc

Please sign in to comment.