diff --git a/Dockerfile b/Dockerfile index 3bec6d3..c48ca53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 && \ diff --git a/rootfs/etc/s6-overlay/startup.d/11-timelapse1090 b/rootfs/etc/s6-overlay/startup.d/11-timelapse1090 new file mode 100755 index 0000000..039b1d5 --- /dev/null +++ b/rootfs/etc/s6-overlay/startup.d/11-timelapse1090 @@ -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