From 705bd42a46581d07608c47ce2653c25382de8242 Mon Sep 17 00:00:00 2001 From: David Shen Date: Fri, 3 Apr 2026 12:59:35 -0400 Subject: [PATCH] Rewrite ghcr.io in devcontainer features to use the pull through cache --- startupscript/butane/005-parse-devcontainer.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/startupscript/butane/005-parse-devcontainer.sh b/startupscript/butane/005-parse-devcontainer.sh index ee15ba06..cd406ed5 100755 --- a/startupscript/butane/005-parse-devcontainer.sh +++ b/startupscript/butane/005-parse-devcontainer.sh @@ -78,6 +78,11 @@ if [[ -d "${DEVCONTAINER_FEATURES_PATH}" ]]; then rsync -a --ignore-existing "${DEVCONTAINER_FEATURES_PATH}/" "${DEVCONTAINER_PATH}/.devcontainer/features" fi +# Rewrite ghcr.io references to use the GAR pull-through cache +readonly GHCR_CACHE="us-central1-docker.pkg.dev/workbench-app-cache/ghcr-cache" +sed -i "s|ghcr\.io/|${GHCR_CACHE}/|g" "${DEVCONTAINER_CONFIG_PATH}" +find "${DEVCONTAINER_PATH}/.devcontainer/features" -name devcontainer-feature.json -exec sed -i "s|ghcr\.io/|${GHCR_CACHE}/|g" {} + + replace_template_options() { local TEMPLATE_PATH="$1"