commit

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

Package commit snapshots a stopped workspace's rootfs back into an OCI image and pushes it to a registry — the reverse of the OCI->rootfs realize path. commit extracts the ext4 rootfs (via debugfs, unprivileged), assembles a single-layer OCI image (pkg/ociimage), and writes it to a local OCI layout; Push copies that image to a registry with ORAS using the same standard pull credentials as the rootfs builder.

Limitation: unprivileged debugfs extraction does not preserve original file ownership, so committed layers record the current user's uid/gid. Content, modes, and symlinks are preserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LayoutPath

func LayoutPath(stateDir string) string

LayoutPath is where committed images are stored as an OCI image layout.

func Push

func Push(ctx context.Context, stateDir, ref string) error

Push copies a previously committed image from the local OCI layout to its registry.

Types

type Options

type Options struct {
	StateDir     string
	DebugFSPath  string
	Workspace    string
	Backend      string
	Reference    string // target image reference, e.g. registry/repo:tag
	Architecture string // OCI architecture; defaults to the guest arch
	CreatedAt    time.Time
}

Options configures a commit.

type Result

type Result struct {
	Reference  string `json:"reference"`
	Digest     string `json:"digest"`
	SizeBytes  int64  `json:"size_bytes"`
	LayoutPath string `json:"layout_path"`
}

Result reports a commit.

func Commit

func Commit(ctx context.Context, opts Options) (Result, error)

Commit snapshots the workspace rootfs into a local OCI image tagged with the target reference.

Jump to

Keyboard shortcuts

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