Skip to content

generic-packs: support oci:// references via install-oci-pack#4164

Draft
ChipWolf wants to merge 1 commit into
itzg:masterfrom
ChipWolf:oci-generic-packs
Draft

generic-packs: support oci:// references via install-oci-pack#4164
ChipWolf wants to merge 1 commit into
itzg:masterfrom
ChipWolf:oci-generic-packs

Conversation

@ChipWolf

@ChipWolf ChipWolf commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Adds OCI registry support to GENERIC_PACKS. An entry that resolves to oci://… (tag or @sha256: digest) is pulled with mc-image-helper install-oci-pack; everything else keeps the existing isURL→local behaviour. Purely additive — oci:// is required, so a bare ghcr.io/… is still treated as a local path.

OCI, URL, and local entries can be mixed in one list and apply in declared order. The OCI branch appends the helper's layer paths to packFiles[] in manifest order, so the existing extract, GENERIC_PACKS_DISABLE_MODS, manifest-diff, and sha1sum checksum pipeline is unchanged.

Design notes

  • Single list, not a new GENERIC_PACKS_OCI var: nothing new to document, preserves cross-scheme ordering, and reuses PREFIX/SUFFIX/DISABLE_MODS and the update/checksum machinery.
  • One new var: GENERIC_PACKS_OCI_AUTH_FILE--auth-file (passed only when set; otherwise the helper's ~/.config/containers/auth.json~/.docker/config.json fallback, else anonymous).
  • Validation is left to the helper: called without --artifact-type/--layer-media-type, so it enforces the modpack artifact + layer media types and rejects non-modpack refs before anything touches /data.
  • --output-directory /data/packs/oci with --filename-strategy digest (fixed): content-addressed cache, so a base layer shared between packs is fetched once.

Helper dependency: install-oci-pack (helper master). The image already pins MC_HELPER_VERSION=1.61.1, which includes it — no bump needed.

Docs: new "Generic packs from an OCI registry" section in docs/mods-and-plugins/index.md.

Test: tests/setuponlytests/generic-packs-oci pulls two demo packs that share a base layer (gated behind EXTENDED_TESTS, since it needs anonymous ghcr.io egress).

Refs #4038

Allow GENERIC_PACKS entries to point at OCI modpack artifacts in a
container registry using an oci:// reference (tag or @sha256: digest).
Such entries are pulled with mc-image-helper install-oci-pack and the
resulting layer paths are appended to packFiles in manifest order, so
the existing extract, disable-mods, manifest-diff, and checksum
pipeline applies unchanged. OCI, URL, and local entries can be mixed
in one list and apply in declared order.

Layers are cached under /data/packs/oci by digest, so a base layer
shared between packs is fetched only once. Registry auth can be
supplied with GENERIC_PACKS_OCI_AUTH_FILE; artifact and layer media
types are validated by the helper.
@ChipWolf

Copy link
Copy Markdown
Contributor Author

@itzg I suggest before merging that I create a template repo for generating these OCI artefacts and you create a repo under your GitHub account that can be used in the docs examples and the tests rather than using my oci-modpack-demo repo

I'll work on that if you reckon that's a good move

@ChipWolf ChipWolf marked this pull request as draft July 14, 2026 10:30
@itzg

itzg commented Jul 14, 2026

Copy link
Copy Markdown
Owner

@itzg I suggest before merging that I create a template repo for generating these OCI artefacts and you create a repo under your GitHub account that can be used in the docs examples and the tests rather than using my oci-modpack-demo repo

I'll work on that if you reckon that's a good move

That would be fantastic.

@itzg

itzg commented Jul 14, 2026

Copy link
Copy Markdown
Owner

The design looks great. I'll try to get to the code review ASAP.

@ChipWolf

Copy link
Copy Markdown
Contributor Author

@itzg

The design looks great. I'll try to get to the code review ASAP.

Thanks!

Here it is https://github.com/ChipWolf/oci-modpack-template

If you're happy with that, feel free to clone, change the remote, and push to your own account

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants