1
0
Fork
You've already forked oci
0
forked from jeffective/oci
OCI specification and builder for Zig
  • Zig 100%
2026年04月14日 14:39:09 -04:00
example fix examples zig version 2026年03月30日 13:41:25 +02:00
src refactor argument passing 2026年03月30日 18:49:11 +02:00
test add hello world executable 2025年12月09日 21:55:50 -08:00
.gitignore Initial implementation of information from the OCI Image Specification 2025年12月09日 21:33:01 -08:00
build.zig add --json-whitespace args 2026年03月30日 13:41:37 +02:00
build.zig.zon pin zig 0.16.0 2026年04月14日 14:39:09 -04:00
LICENSE Initial commit 2025年12月10日 05:15:57 +01:00
README.md add quick start information to README.md 2026年04月04日 11:56:25 -07:00

OCI

OCI (Open Container Initiative) specification and builder for Zig.

Quick Start

Add oci as a dependency to your project.

zig fetch --save git+https://codeberg.org/jeffective/oci.git

Development

zig build

References

Design

User's build graph:

  1. make layers (set of filesystem operations) based on build artifacts (executables etc)
  2. make manifest from layers
  3. make index from manifests

API Inspiration / Prototype:

constimage=oci.createImage(b,.{});constmanifest=image.addManifest(.{.target=target,});constexe_layer=manifest.addLayer(.{.compression=.gzip_best,});exe_layer.addFile(exe.getEmittedBin(),"/bin/hello-world");constconfig_layer=manifest.addLayer(.{.compression=.gzip_best,});config_layer.addFile(b.path("etc/config.json"),"/etc/config.json");config_layer.addFile(b.path("etc/config2.json"),"/etc/config2.json");

TODO / Discussion:

  • add emit docs build step
  • download image to use as base image for createManifest
    • this is really hard, looks like container registeries dont provide a simple tar.gz endpoint...
  • setup CI
  • fix build steps to allow user to actually use this package, something like const dep = b.dependencyFromBuildZig(@This(), options);
  • path names on windows might be wrong? see create_layer.zig, create_layout.zig etc. Need to make sure paths going into the tars are not windows paths?
  • architecture variants
  • reconsider current approach to file permissions