Skip to content

feat: portable OCX home export/import for air-gapped environments #25

@michael-herwig

Description

@michael-herwig

Context

An OCX home directory already contains everything needed for offline package use: content-addressed objects, a local index with resolved metadata, and install symlinks. Packaging this into a self-contained archive would enable air-gapped deployments without a registry.

This depends on #23 (relative symlinks within OCX home) to ensure the archive is relocatable.

Ref: Nesbitt's article on OCI and package registries notes that .deb/.rpm files are self-contained while OCI artifacts require manifest + blobs. OCX's local store already bridges this gap — this feature formalizes it.

Proposed Commands

ocx export [packages...] --output <path.tar.gz>
ocx import <path.tar.gz> [--home <target>]

Export

  • Resolves the specified packages (or all installed) to their object store entries + index data
  • Creates a tar archive containing the subset of OCX home needed for those packages
  • Symlinks within the archive are relative (depends on relative symlinks feature)
  • Index entries included so ocx commands work offline against the imported home

Import

  • Extracts into target $OCX_HOME (or a specified path)
  • Merges with existing content (content-addressed = no conflicts for identical digests)
  • Recreates install symlinks

Relationship to OCI Layout

OCI defines an image layout format for on-disk storage. We should evaluate whether export should produce:

  1. An OCX-native archive (simpler, works with ocx import only)
  2. An OCI layout directory (interoperable with oras, skopeo, crane)
  3. Both (OCX-native as default, --format oci-layout option)

Depends On

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions