From 40ac6bcdfb3ba7067f215c069a62f1458ada1ee6 Mon Sep 17 00:00:00 2001 From: Felddy Date: Mon, 10 Feb 2025 12:40:36 -0500 Subject: [PATCH] Add cache tag file to container cache directory Closes #1151 Add support for `CACHEDIR.TAG` files to the container cache --- src/entrypoint.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/entrypoint.sh b/src/entrypoint.sh index 5a4cae86..7d74cb8a 100755 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -144,6 +144,13 @@ if [ $install_required = true ]; then if [[ "${CONTAINER_CACHE:-}" ]]; then log "Using CONTAINER_CACHE: ${CONTAINER_CACHE}" mkdir -p "${CONTAINER_CACHE}" + # Create a cache marker file in the cache directory. + cat << END_OF_LINE > "${CONTAINER_CACHE}/CACHEDIR.TAG" +Signature: $(printf ".IsCacheDirectory" | md5sum | cut -d ' ' -f 1) +# This file is a cache directory tag created by the felddy/foundryvtt container +# https://github.com/felddy/foundryvtt-docker +# For information about cache directory tags see https://bford.info/cachedir/ +END_OF_LINE else log_warn "CONTAINER_CACHE has been unset. Release caching is disabled." fi