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.
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 ¶
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.