registryrelay

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package registryrelay implements the Registry relay (ADR 0043). On a VM runtime the runtime's daemon pushes and pulls images from inside its VM, where the host's loopback addresses don't reach: it is a VM-side client. The Registry relay is a Managed container in the VM's host network namespace that listens on 127.0.0.1 at the registry's port and pipes each connection to the registry's address on the services network, which the VM relay serves. VM-side clients then use the same image references as Host clients.

Index

Constants

View Source
const Suffix = "registryrelay"

Suffix names the container (runtime.Manager.Name).

Variables

View Source
var ErrPortTaken = errors.New("the port is taken inside the runtime's VM")

ErrPortTaken is returned by Start when something in the VM already listens on 127.0.0.1 at the port.

Functions

func Leftovers

func Leftovers(ctx context.Context, cl *runtime.Client, dir string) ([]runtime.Container, error)

Leftovers returns the Registry relays of the Instance whose data dir is dir (absolute), as its labels name it, or of every Instance when dir is "": one a previous run left behind holds the registry's port on the host on OrbStack and Colima.

func Remove

func Remove(ctx context.Context, rt *runtime.Manager) error

Remove removes the Instance's Registry relay, if there is one (Reset).

func Start

func Start(ctx context.Context, rt *runtime.Manager, o Options) error

Start removes any Registry relay the Instance left behind and starts a new one. It returns ErrPortTaken, and leaves no container, when the port is in use inside the VM.

Types

type Options

type Options struct {
	// Port is the registry's port, which the relay listens on at
	// 127.0.0.1 inside the VM.
	Port int
	// Target is the registry's address on the services network.
	Target string
	Log    *slog.Logger
}

Options configure Start.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL