Automates mounting shared NFS cache exports across macOS and Linux clients over Tailscale, VPN, or LAN.
Source · Systems map · Documentation
The host mounts shared NFS cache directories and exposes them to local tools; the cache server remains a separate trusted machine.
flowchart LR
NFS[Trusted NFS server] --> Host[macOS or Linux host mounts]
Host --> Apps[Docker, Ollama and package tools]
Hub[Optional Hub status view] -. reads configuration .-> Host
| Feature | What it provides |
|---|---|
| Shared cache mounts | Expose Docker, Ollama, npm and Hugging Face caches over trusted NFS. |
| Host integration | Use launchd on macOS or fstab/systemd mount paths on Linux. |
| Hub visibility | Provide configuration that Hub can display while the host performs mounts. |
Create a local config file before running the scripts:
cp ./cache-mounts.conf.example ./cache-mounts.confSet at least:
CACHE_SERVER: hostname or IP reachable on your VPN/LANCACHE_NAMES: caches to mount, separated by spaces or commas (defaults todocker ollama npm huggingface)CACHE_EXPORT_BASE: export root on the server (defaults to/srv/cache)
You can also override individual exports or mount points with variables such as:
CACHE_EXPORT_DOCKERCACHE_EXPORT_HUGGINGFACECACHE_MOUNT_HUGGINGFACE
- Exports:
/srv/cache/<name> - Linux mounts:
/mnt/cache/<name> - macOS mounts:
/Volumes/cache-<name>
Out of the box, the example config covers:
- Docker caches
- Ollama models
- npm caches
- Hugging Face caches
./scripts/macos_install.shThe launchd job re-runs
macos_mount.shevery 5 minutes as your user. Because the mount script callssudo, unattended re-mounts only work if your user has passwordless sudo formount/mkdir; otherwise use the manual mount commands.
./scripts/macos_mount.sh./scripts/macos_unmount.sh./scripts/linux_install.sh./scripts/linux_mount.sh./scripts/linux_unmount.sh- Requires NFS client packages:
- macOS: built-in
- Ubuntu/Debian:
sudo apt-get install -y nfs-common
- All scripts read
cache-mounts.conffrom the repo root if present (regardless of the directory you run them from). SetCACHE_MOUNTS_CONFIG=/path/to/confto use a different file, or export the same variables in your shell. - Linux install writes the resolved server/export paths into
/etc/fstab; rerun it after changing the config.
The CI Hub marketplace app ci-tools-cache-mounts runs
ghcr.io/companionintelligence/ci-tools-cache-mounts (built from the Dockerfile in this
repo). It serves only the static status/reference page in status/ — the actual NFS
mounts are configured host-side with the scripts above; a container cannot create host
mounts. Treat the container as an install confirmation plus quick-reference card.
| Variable | Default | Purpose |
|---|---|---|
CACHE_SERVER |
Set in cache-mounts.conf |
Hostname/IP for the NFS server |
CACHE_NAMES |
docker ollama npm huggingface |
Shares to mount |
CACHE_EXPORT_BASE |
/srv/cache |
Server-side export root |
| macOS mount | /Volumes/cache-<name> |
Client mount path |
| Linux mount | /mnt/cache/<name> |
Client mount path |
flowchart LR
Clients[macOS and Linux clients] --> VPN[Trusted LAN or Tailscale]
VPN --> NFS[NFS cache server]
NFS --> Shares[docker / ollama / npm / huggingface]
Shares --> Tools[Docker, Ollama, npm, Hugging Face]
NFS exports should be restricted to the trusted VPN range or explicit client IPs. macOS unattended mounts need the documented mount permissions; Linux uses _netdev entries and requires an NFS client package. The Hub status app is informational—the mount operation runs on the host. See operations and troubleshooting.