From dd2ebb043ca18924f22b2c79c867334d458c46b3 Mon Sep 17 00:00:00 2001 From: bitgully <32452884+bitgully@users.noreply.github.com> Date: Sun, 3 Mar 2024 19:45:14 +0100 Subject: [PATCH] placeholder feature for mirror registries added to docs --- dependency_cache.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dependency_cache.go b/dependency_cache.go index 3d7bb55..5dda859 100644 --- a/dependency_cache.go +++ b/dependency_cache.go @@ -77,11 +77,14 @@ type DependencyCache struct { // agent (/). // Mappings will be read from any libcnb.Binding in the context with type "dependency-mappings". // -// If dependencies should not be downloaded directly, but need to be pulled from a mirror registry (e.g. in air-gapped environments), -// the alternative URI can either be provided as environment variable "BP_DEPENDENCY_MIRROR", or by a binding of type "dependency-mirror" -// where a file named "uri" must provide the desired location. -// The two schemes https:// and file:// are supported in mirror URIs where the expected format is (parts in "[]"" are optional): +// In some air-gapped environments, dependencies might not be download directly but need to be pulled from a local mirror registry. +// In such cases, an alternative URI can either be provided as environment variable "BP_DEPENDENCY_MIRROR", or by a binding of type "dependency-mirror" +// where a file named "uri" holds the desired location. +// The two schemes https:// and file:// are supported in mirror URIs where the expected format is (optional parts in "[]"): // ://[:@][:][/] +// The optional path part of the provided URI is used as a prefix that might be necessary in some setups. +// This (prefix) path may also include a placeholder of "{originalHost}" at any level (in sub-paths or at top-level) and is replaced with the +// hostname of the original download URI at build time. A sample mirror URI might look like this: https://local-mirror.example.com/buildpacks-dependencies/{originalHost} func NewDependencyCache(context libcnb.BuildContext) (DependencyCache, error) { cache := DependencyCache{ CachePath: filepath.Join(context.Buildpack.Path, "dependencies"),