From 80f201f9ee609e31f0080f54e84b79dbf0872ce7 Mon Sep 17 00:00:00 2001 From: Colin Dean Date: Wed, 22 Jan 2025 00:34:37 -0500 Subject: [PATCH] Adds caching proxy example using HOMEBREW_ARTIFACT_DOMAIN I brought this up several months ago and got a solution working that's been running on my work machine since early September without failure. --- docs/Tips-N'-Tricks.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/Tips-N'-Tricks.md b/docs/Tips-N'-Tricks.md index 3e82d45543..86a6dcf9a3 100644 --- a/docs/Tips-N'-Tricks.md +++ b/docs/Tips-N'-Tricks.md @@ -121,3 +121,18 @@ If you're using Homebrew on macOS Intel, you should also fix permissions afterwa ```sh sudo chown -R "${USER}" /usr/local/etc ``` + +## Use a caching proxy or mirror for Homebrew bottles + +You can configure Homebrew to retrieve bottles from a caching proxy or mirror. + +For example, in JFrog's Artifactory, accessible at `https://artifacts.example.com`, +configure a new "remote" repository with `homebrew` as the "repository key" and `https://ghcr.io` as the URL. + +Then, set these environment variables for Homebrew to retrieve from the caching proxy. + +```sh +export HOMEBREW_ARTIFACT_DOMAIN=https://artifacts.example.com/artifactory/homebrew/ +export HOMEBREW_ARTIFACT_DOMAIN_NO_FALLBACK=1 +export HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN="$(printf 'anonymous:' | base64)" +```