Skip to content

Commit

Permalink
move COPY rootfs after run
Browse files Browse the repository at this point in the history
this helps with build caching when doing changes to container scripting
  • Loading branch information
wiedehopf committed Jun 11, 2024
1 parent 82e0ebc commit 67599a6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ ENV BEASTPORT=30005 \

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

#COPY rootfs/tar1090-install.sh /
#COPY rootfs/etc/nginx.tar1090 /etc/nginx.tar1090
# for dev testing, rootfs copy can be moved after run, then these two lines above are needed

COPY rootfs/ /

# add telegraf binary
##telegraf##COPY --from=telegraf /usr/bin/telegraf /usr/bin/telegraf

RUN set -x && \
RUN \
--mount=type=bind,source=./,target=/app/ \
set -x && \
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
# Essentials (git is kept for aircraft db updates)
Expand Down Expand Up @@ -69,7 +65,7 @@ RUN set -x && \
# nginx: remove default config
rm /etc/nginx/sites-enabled/default && \
# tar1090: install using project copy of original script
bash /tar1090-install.sh /run/readsb webroot "${TAR1090_INSTALL_DIR}" && \
bash /app/rootfs/tar1090-install.sh /run/readsb webroot "${TAR1090_INSTALL_DIR}" && \
# change some /run/tar1090-webroot to /run/readsb to make work with existing docker scripting
sed -i -e 's#/run/tar1090-webroot/#/run/readsb/#' /usr/local/share/tar1090/nginx-tar1090-webroot.conf && \
# tar1090-db: document version
Expand All @@ -83,7 +79,7 @@ RUN set -x && \
# tar1090: remove tar1090-update files as they're not needed unless tar1090-update is active
rm -rf "${TAR1090_UPDATE_DIR}" && \
# tar1090: add nginx config
cp -Rv /etc/nginx.tar1090/* /etc/nginx/ && \
cp -Rv /app/rootfs/etc/nginx.tar1090/* /etc/nginx/ && \
# 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 @@ -176,6 +172,8 @@ RUN set -x && \
popd && \
rm -rf /tmp/*

COPY rootfs/ /

EXPOSE 80/tcp

# Add healthcheck
Expand Down

0 comments on commit 67599a6

Please sign in to comment.