image

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 10 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 image extracts a rootfs into a destination directory. There are two supported sources:

  • SeedDir(src, dst, exclude): copy a local directory tree into dst. Used by `init --from <dir|/>` — the production path that wraps an existing container fs into a managed rootfs.
  • MaterializeTarball(src, dst): extract a .tar / .tar.gz from a local path or http(s) URL. Used by `init --tarball <path>` for demos and air-gapped setups.

Both run on stdlib only and apply the traversal-safe extractTar / walk logic in this package — there is no separate "pull from a registry" path because that would either need go-containerregistry's heavy dep tree or a fragile HTML-scraping mirror crawler. Users who want a container image should `docker export` it to a tarball and pass it via --tarball.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaterializeTarball

func MaterializeTarball(src, destRootfs string) error

MaterializeTarball extracts a .tar or .tar.gz at src (filesystem path or http/https URL) into destRootfs, which must already exist. The tarball stream goes through extractTar's traversal-safe handling (zip-slip / symlink-plant / hardlink-escape).

func SeedDir

func SeedDir(src, dst string, exclude map[string]bool) error

SeedDir copies the tree at src into dst, skipping any path in exclude (and not descending into excluded directories). It is best-effort: unreadable files (e.g. root-owned files when running unprivileged) and special files (devices, FIFOs, sockets) are skipped rather than aborting — so seeding from "/" inside a container works even as a non-root user.

Types

This section is empty.

Jump to

Keyboard shortcuts

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