diff --git a/.gitea/README.md b/.gitea/README.md index 72c3554..36fb81c 100644 --- a/.gitea/README.md +++ b/.gitea/README.md @@ -81,11 +81,20 @@ content: ```sh { cat Dockerfile.base - find rootfs -type f -print0 | sort -z | xargs -0 cat + find rootfs -type f \ + ! -path '*/__pycache__/*' \ + ! -name '*.pyc' \ + ! -name '.DS_Store' \ + ! -name '._*' \ + -print0 | sort -z | xargs -0 cat cat entrypoint.sh entrypoint-user.sh } | sha256sum | cut -c1-12 ``` +Junk filters keep the local recompute reproducible against CI's clean +checkout — `__pycache__/*.pyc` and macOS metadata files (`.DS_Store`, +`._AppleDouble`) are gitignored but still walked by `find -type f`. + The 12-character truncated hash becomes `base-`. Probe Docker Hub for this tag via `docker manifest inspect`: diff --git a/.gitea/workflows/docker-publish-split.yml b/.gitea/workflows/docker-publish-split.yml index 66be77f..6064581 100644 --- a/.gitea/workflows/docker-publish-split.yml +++ b/.gitea/workflows/docker-publish-split.yml @@ -63,10 +63,19 @@ jobs: run: | # Hash inputs that determine the base image's contents. # Order is fixed via `find -print0 | sort -z` for reproducibility. + # Junk filters: __pycache__/*.pyc and macOS metadata (.DS_Store, + # ._AppleDouble) are gitignored locally but still picked up by + # `find rootfs -type f`, which would diverge the local hash from + # CI's clean checkout. Exclude them defensively here. HASH=$( { cat Dockerfile.base - find rootfs -type f -print0 2>/dev/null | sort -z | xargs -0 cat 2>/dev/null + find rootfs -type f \ + ! -path '*/__pycache__/*' \ + ! -name '*.pyc' \ + ! -name '.DS_Store' \ + ! -name '._*' \ + -print0 2>/dev/null | sort -z | xargs -0 cat 2>/dev/null cat entrypoint.sh entrypoint-user.sh } | sha256sum | cut -c1-12 )