image

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package image opens a container image and yields its final filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenBaseLayer added in v0.5.0

func OpenBaseLayer(ctx context.Context, ref, platform string, rt http.RoundTripper) (io.ReadCloser, error)

OpenBaseLayer returns the uncompressed tar of a registry image's first (lowest) layer, where a base image keeps its OS release files, through rt. Reading one layer bounds what a base-image lookup downloads. Every request, the layer download included, is bound to ctx.

func Platforms

func Platforms(ref string) ([]string, error)

Platforms lists the platforms a registry reference offers (empty for a single-platform image), skipping attestation manifests.

Types

type Opened

type Opened struct {
	// FS is the final filesystem as a tar stream, whiteouts applied.
	FS io.ReadCloser
	// Digest is the image manifest digest.
	Digest string
	// Platform is the platform that was opened, when known.
	Platform string
	// Env is the image configuration's environment.
	Env []string
	// Command is what the container runs: the configuration's Entrypoint
	// followed by its Cmd.
	Command []string
	// Entrypoint and Cmd are the configuration's own.
	Entrypoint, Cmd []string
}

Opened is an image's flattened filesystem and what identifies it.

func Open

func Open(ref, platform string) (*Opened, error)

Open resolves ref and returns the image's flattened filesystem.

docker-archive:PATH   a tarball from `docker save`
anything else         a registry reference, e.g. php:8.3-fpm or ghcr.io/o/r@sha256:...

func OpenRegistry added in v0.5.0

func OpenRegistry(ref, platform string, rt http.RoundTripper) (*Opened, error)

OpenRegistry is Open for a registry reference only, with every request carried by rt: a caller scanning references it does not trust passes a guarded transport (internal/netguard). Local archives are refused.

Jump to

Keyboard shortcuts

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