Documentation
¶
Overview ¶
Package image copies and flattens a container image's filesystem to a local directory using skopeo, and reports the image configuration.
Flattening is faithful enough to reason about what the image actually ships: whiteouts are applied (so a file deleted by a later layer is really gone), symlinks are recreated as symlinks (so shared-library soname resolution can follow them), and hardlinks are materialized. Extraction is hostile-input safe: every entry path is resolved inside the destination root, so a layer containing a symlink to /etc cannot write through it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extractor ¶
type Extractor struct {
// OS and Arch select the platform variant to pull (default linux/amd64).
OS string
Arch string
// SkopeoPath overrides the skopeo binary (default: found on PATH).
SkopeoPath string
}
Extractor flattens container images.
func NewExtractor ¶
func NewExtractor() *Extractor
NewExtractor returns an Extractor with linux/amd64 defaults.
func (*Extractor) Extract ¶
Extract copies ref into a temporary OCI dir with skopeo and untars every layer, in order, into dest. Later layers overwrite earlier ones and their whiteouts delete from earlier ones, yielding the final image filesystem state. The returned Image owns no resources: dest stays the caller's to clean up.