Documentation
¶
Overview ¶
Package mirror rewrites docker.io image references in compose YAML to point at an alternate registry (typically a GHCR mirror). Intended for CI/E2E where Docker Hub rate limits can block deploys, but the same mechanism works for local dev when SIMPLEDEPLOY_IMAGE_MIRROR_PREFIX is set.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RewriteCompose ¶
RewriteCompose returns composeYAML with every docker.io-bound image reference rewritten to prefix + normalized path. prefix must include trailing slash (e.g. "ghcr.io/vazra/"). If prefix is empty, returns the input unchanged.
Rules:
- Images already targeting a non-default registry (ghcr.io, quay.io, any host with "." or ":" in the first path segment) are left alone.
- Official images (no namespace) get "library/" stripped; a single segment "nginx:alpine" becomes "<prefix>nginx:alpine".
- Digest refs (@sha256:...) and tags (:tag) are preserved verbatim.
func RewritePortsLoopback ¶
RewritePortsLoopback prefixes every "host:container" ports list entry with "127.0.0.1:" so the published port is reachable only from the host itself. Caddy still proxies external traffic to the same upstream (resolved as localhost:host_port), so external behavior is unchanged while the bypass-Caddy hole is closed.
Operator-explicit entries (already pinned to an IP) are left alone. Set SIMPLEDEPLOY_DISABLE_PORT_LOOPBACK=true to skip the rewrite globally.
Types ¶
This section is empty.