forked from jeffective/oci
OCI specification and builder for Zig
- Zig 100%
| example | fix examples zig version | |
| src | refactor argument passing | |
| test | add hello world executable | |
| .gitignore | Initial implementation of information from the OCI Image Specification | |
| build.zig | add --json-whitespace args | |
| build.zig.zon | pin zig 0.16.0 | |
| LICENSE | Initial commit | |
| README.md | add quick start information to README.md | |
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:
- make layers (set of filesystem operations) based on build artifacts (executables etc)
- make manifest from layers
- 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