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:
- An OCX-native archive (simpler, works with
ocx import only)
- An OCI layout directory (interoperable with
oras, skopeo, crane)
- Both (OCX-native as default,
--format oci-layout option)
Depends On
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/.rpmfiles are self-contained while OCI artifacts require manifest + blobs. OCX's local store already bridges this gap — this feature formalizes it.Proposed Commands
Export
ocxcommands work offline against the imported homeImport
$OCX_HOME(or a specified path)Relationship to OCI Layout
OCI defines an image layout format for on-disk storage. We should evaluate whether export should produce:
ocx importonly)oras,skopeo,crane)--format oci-layoutoption)Depends On